-
Bug
-
Resolution: Fixed
-
1.15.2, 20w12a, 20w13a, 20w14a, 20w16a, 20w17a, 20w18a, 20w22a, 1.16 Pre-release 2, 1.16 Pre-release 3, 1.16 Pre-release 6, 1.16.2 Release Candidate 1, 1.16.3, 20w45a, 20w51a, 21w03a, 1.16.5, 21w08b, 21w10a, 1.17, 1.17.1, 1.18.2, 22w18a, 1.19, 1.19.2
-
Confirmed
-
Commands
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.