Open AgainPsychoX opened 2 years ago
Workarounds I tried but failed:
Workaround is to use json
:
?furnace_minecart_name_snbt = json {"text": "Minecart with Furnace"}
In raw commands, you need to use single quotes, like:
/summon minecraft:chest_minecart ~ ~ ~ {CustomDisplayTile:1b,DisplayOffset:6,Tags:["furnace_minecart"],CustomName:'{?furnace_minecart_name_snbt}',DisplayState:{Name:"minecraft:furnace"}}
(if you use "{?furnace_minecart_name_snbt}" it will fail, because quotes will not be escaped.)
In raw selectors, you use double quotes (they will be escaped):
for @item{Item:{id:"minecraft:minecart",Count:1b,tag:{display:{Name:"{?furnace_minecart_name_snbt}"}}}} {
...
This is inconsistency, but at least it works.
BTW: Using double quotes causes warning in VSCode with Data-pack Helper Plus extension, since there is rule preferring single quote to encapsulate stuff, so I guess single quotes should be used to fix the bug.
Code
It compiles, but does not load/work properly, as generated
mcfunction
s are invalid.Generated output
replace_drops.mcfunction
_b_$.mcfunction
(body of firstfor
statement)Expected output
Example using escaping double quotes with slash:
Example using encapsulating with single quote:
It's expected the SNBT would be escaped, by slashes (
"
to\"
in escaped string) or by encapsulating it in single quotes ('
).Also, it won't work without key quotes while executing in Minecraft ("text": ...
works,text: ...
does not).EDIT: Using SNBT was not valid here, but the issue with quotes is still a bug, both for SNBT and JSON.
_(
CustomName
requires JSON format)_