To Reproduce
✔ Double quotation marks work
/data get entity @s "Inventory"
❌ Single quotation marks don't work. Instead, the error message “{{Found no element matching 'Inventory'}}” is shown.
/data get entity @s 'Inventory'
Code Analysis
Super duper Mojang mappings, 20w12a.
The function net/minecraft/commands/arguments/NbtPathArgument#parseNode
calls the StringReader#readString
method, which does support single quotation marks. However, it is only called if the string starts with a double quotation mark ("
). Otherwise the node is considered as an unquoted name.
The missing case for single quotation marks ('
) should be added in the parseNode
method.
Also, you might want to add character != '\''
to net/minecraft/commands/arguments/NbtPathArgument#isAllowedInUnquotedName
as well.
It might be WAI:
Source: https://gist.github.com/Dinnerbone/943fbcd763c19be188ed6b72a12d7e65