mojira.dev
MC-45412

/clear command does not clear custom item names that contain spaces

The clear command has the ability to be used only to clear renamed items: /clear @p minecraft:stone 0 5 {display:{Name:Best}} will not clear regular stone blocks, but will clear stone blocks named "Best". However, the clear command will fail if the item name in the brackets contains a space: /clear minecraft:stone 0 5 {display:{Name:The Best}} will not work. As shown in the included image, the space in the item name cuts off the end of the command.
The command will also fail when the Name tag is put in quotation marks. {display:{Name:"The Best"}} will claim that the string parsing fails due to an unbalance quotation as opposed to a bracket.

Linked issues

Attachments

Comments 6

Invalid, malformed command.

try Name:"The Best"

The response is near-identical: string parsing fails because of an unbalanced quotation.

I did some testing, {"display":{"Name":"Item test"}} is valid JSON according to the JSON specification, however, it doesn't work in Minecraft.

Data tag parsing failed: Unbalanced quotation: {"display":{"Name":"Item

Yep, I just tried this. I can't get it to work either. The brackets do not like having that space there, that's for sure. It disregards the quotation marks like they're basic characters too, so that doesn't help either. For the time being you might just have to deal with no spaces in the name.

Edit: An underscore will easily solve the problem, you'll just have a small line in the name, it's not as big of a deal as changing the name is.

Keep in mind MC does not adhere to the JSON specification... however it is very close.

I'm still poking around with this, and feel the answer should be right in front of me.

OK still going to poke around with this but... Duplicate of MC-44688

Maxwell

(Unassigned)

Unconfirmed

Minecraft 14w03b

Retrieved