I believe function macros are one of the most significant updates to Minecraft commands since the 1.13 update. However, I think there’s still much room for improvement, particularly in how keys are handled in input.
Currently, key inputs are limited to "a"-"z", "A"-"Z", "0"-"9", and "_", which only allows accessing elements under root tags. If additional characters like ".", "[", "]", "{", "}", "-", and ":" were permitted—and if keys inside "$()" could be parsed as NBT paths—it would drastically reduce the unnecessary effort required by datapack creators.
Example Use Cases:
To access the value of B inside the first compound element (index 0) of a list named A in an entity’s NBT data, the command could look like this:
$say $(A[0].B) with entity @s data
If the specified NBT path doesn’t exist, it should return an empty value. For example:
$say $(A[{B:1}]) with entity @s data
would resolve to:
say with entity @s data
I understand that this change would affect some of the underlying logic of function macros regarding keys, but I believe it’s necessary. Such an improvement would greatly contribute to the advancement of datapacks—at the very least, developers wouldn’t have to manually write list-handling logic anymore. XD
Thank you for your hard work, Mojang! Your efforts are truly appreciated.
Please sign in to leave a comment.
0 Comments