@@ -226,6 +226,7 @@ def get_default_parsers() -> Dict[str, Parser]:
226226 "nbt_compound_entry" : nbt_parser .parse_compound_entry ,
227227 "nbt_list_or_array_element" : delegate ("nbt" ),
228228 "nbt_compound" : NbtCompoundParser (delegate ("nbt" )),
229+ "nbt_list" : NbtListParser (delegate ("nbt" )),
229230 "adjacent_nbt_compound" : AdjacentConstraint (delegate ("nbt_compound" ), r"\{" ),
230231 "nbt_path" : NbtPathParser (
231232 integer_parser = delegate ("integer" ),
@@ -239,7 +240,7 @@ def get_default_parsers() -> Dict[str, Parser]:
239240 [delegate ("resource_location" ), delegate ("nbt_compound" )]
240241 ),
241242 "resource_location_or_nbt_list" : AlternativeParser (
242- [delegate ("resource_location_or_nbt" ), delegate ("nbt " )]
243+ [delegate ("resource_location_or_nbt" ), delegate ("nbt_list " )]
243244 ),
244245 "uuid" : parse_uuid ,
245246 "objective" : BasicLiteralParser (AstObjective ),
@@ -1325,6 +1326,15 @@ class NbtCompoundParser(TypeConstraint):
13251326 message : str = "Expected nbt compound."
13261327
13271328
1329+ @dataclass
1330+ class NbtListParser (TypeConstraint ):
1331+ """Parser for nbt compounds."""
1332+
1333+ parser : Parser = field (default_factory = NbtParser )
1334+ type : Union [Type [Any ], Tuple [Type [Any ], ...]] = AstNbtList
1335+ message : str = "Expected list compound."
1336+
1337+
13281338@dataclass
13291339class AdjacentConstraint :
13301340 """Constraint that ensures that there are no whitespace separators."""
0 commit comments