mojira.dev
MC-238445

Commands with quotation marks (") cannot be put in a setblock command

commands like /execute if entity @p[nbt={Inventory:[{id:"minecraft:diamond"}]}] cannot be put in 

 

/setblock <x> <y> <z> command_block 0 replace {Command:"execute if entity @p[nbt={Inventory:[{id:"minecraft:diamond"}]}]"}

{{}}

because the quotation marks interfear

Comments 1

Invalid, you're trying to put a string in a string, without escaping quotation marks. You either need to use " for one string and ' for the other, or escape the inner string with backslashes.

EneAgaNH

(Unassigned)

Unconfirmed

(Unassigned)

1.17.1

Retrieved