Closed simonfruehauf closed 4 years ago
You can use a backslash ( \
, written in configs as \\
) to escape the leading curly bracket.
So your command should look like this: entitydata @e[type=minecraft:creeper,distance=..1] \\{NoAI:1}
In case that doesn't help, try a single backslash: entitydata @e[type=minecraft:creeper,distance=..1] \{NoAI:1}
The first solution (\\
) gives me a console error , the second one (\
) a chat error .
EDIT: nevermind, it worked after restarting the server a couple times.
I've been trying something else, in this case this "execute as {player} at @s run setblock ^ ^ ^ minecraft:chest\\{LootTable:"minecraft:chests/simple_dungeon"\\}"
command, escaping the curly brackets, but that throws an error.
Escaping the colon : and the double quotes inside the command also gives the same error.
Even when just escaping the opening i get this error.
[15:34:51] [Server thread/INFO]: Failed to read the configuration:
[15:34:51] [Server thread/INFO]: while scanning a plain scalar
in 'reader', line 193, column 125:
... ^ minecraft:chest\\{LootTable:"minecraft:chests/simple_dungeon"}" }
^
found unexpected ':'
in 'reader', line 193, column 134:
... aft:chest\\{LootTable:"minecraft:chests/simple_dungeon"}" }
^
Please check http://pyyaml.org/wiki/YAMLColonInFlowContext for details.
at [Source: (File); line: 193, column: 7]
at [Source: (File); line: 193, column: 7] (through reference chain: me.yamakaja.commanditems.data.CommandItemsConfig["items"]->java.util.LinkedHashMap["creep"]->me.yamakaja.commanditems.data.ItemDefinition["actions"]->java.lang.Object[][0])
The lack of space is intentional (the original command is setblock ^ ^ ^ minecraft:chest\\{LootTable:"minecraft:chests/simple_dungeon"}"
), which works without issue when used in the console.
Yeah, you need to pay attention to your quotes (You can’t use double-quotes inside of double quotes without escaping them).
I‘d suggest replacing your outer quotes with ’ and then replacing \\ with a single \
Thank you very much!
Using a { or } inside a command, e.g.
entitydata @e[type=minecraft:creeper,distance=..1] {NoAI:1}
does not successfully execute. The error logged isCaused by: java.lang.RuntimeException: Attempt to access undefined local 'NoAI:1"'!
. It seems that curly brackets inside quotation marks do not get escaped correctly, even if using a .