-
Bug
-
Resolution: Invalid
-
None
-
1.21.2 Release Candidate 2, 1.21.3
-
None
-
Unconfirmed
-
(Unassigned)
When trying to refer to a previously stored CustomName from an Entity or minecraft:custom_name component from items with macro functions the returned value does not include escaping of special character like single quotation marks, which causes dynamic functions to break.
So for example if I store the name of an entity which has "Bob's Burger" as a name with the command:
/data modify storage test:storage saved_name set from entity @n[type=!player] CustomName
It would then store the data as:
saved_name: '"Bob\'s Burger"'
But when I then try to use the stored data in a macro command it removes the escaping of the single quotation mark which causes the command/function to fail. Here's also an example of a command I've tried for testing:
$execute as @a at @a if items entity @s container.* minecraft:goat_horn[minecraft:custom_data={wawo:goat_horn_tp},minecraft:custom_name='$(saved_name)'] run say success
(Same happens with any other command when I use the variable and I've also tested it without the single quotation marks for the custom_name field)