diff --git a/src/parsers/NbtArgumentParser.ts b/src/parsers/NbtArgumentParser.ts index ce017329a..19320a2db 100644 --- a/src/parsers/NbtArgumentParser.ts +++ b/src/parsers/NbtArgumentParser.ts @@ -410,11 +410,6 @@ export default class NbtArgumentParser extends ArgumentParser { const result = this.parsePrimitiveTag(reader, superNode, helper) combineArgumentParserResult(ans, result) reader.skipWhiteSpace() - if (reader.peek() === ',') { - reader - .skip() - .skipWhiteSpace() - } if (ans.data[NbtNodeType] === 'ByteArray') { ans.data.push(result.data as NbtByteNode) if (!isNbtByteNode(result.data)) { @@ -455,6 +450,13 @@ export default class NbtArgumentParser extends ArgumentParser { ) } } + if (reader.peek() === ',') { + reader + .skip() + .skipWhiteSpace() + continue + } + break } reader .expect(']')