diff --git a/Insights/src/main/java/dev/frankheijden/insights/commands/parser/ScanObjectArrayParser.java b/Insights/src/main/java/dev/frankheijden/insights/commands/parser/ScanObjectArrayParser.java index 9f2dbb2..510a877 100644 --- a/Insights/src/main/java/dev/frankheijden/insights/commands/parser/ScanObjectArrayParser.java +++ b/Insights/src/main/java/dev/frankheijden/insights/commands/parser/ScanObjectArrayParser.java @@ -30,7 +30,13 @@ public ScanObjectArrayParser(ParserParameters options) { @Override public ArgumentParseResult[]> parse(CommandContext ctx, CommandInput input) { try { - int queueSize = input.length(); + // Find the index of the first item in the *actual* input + // input.input() is the entire command + int indexOf = input.input().indexOf(input.peekString()); + + // Find the number of elements that need to be in the array + int queueSize = input.input().substring(indexOf).split(" ").length; + List> items = new ArrayList<>(queueSize); for (var i = 0; i < (queueSize - 1); i++) { items.add(ScanObject.parse(input.peekString()));