Mojira Archive
MC-133726

Cannot execute a block that has a colored custom name

Trying to use

execute as @a at @a if block (...)

with a block that supports the CustomName nbt data (like dispensers for example) will fail if the CustomName contains a color code. Here is such an example.

 

Run this on a dispenser:

data merge block ~ ~-1 ~ {CustomName:"{\"text\":\"\\u00a73Special Crafts\"}"}

Then try this:

execute as @s at @s if block ~ ~-1 ~ minecraft:dispenser{CustomName:"{\"text\":\"\\u00a73Special Crafts\"}"} run say Hi.

The code will not execute. I ran

data get block ~ ~-1 ~

on the block, and noticed that the escape code is not present in CustomName. Instead, the text is colored.

This may suggest that instead of the nbt being saved as literally:

{\"text\":\"\\u00a73Special Crafts\"}

It is saved as this instead:

{\"text\":\"§4Special Crafts\"}

If it is indeed stored that way, testing for a colored custom name is not possible, as "§" is not a typeable character in command blocks. Please fix this.

Edit: Added world download to showcase issue

Invalid

Develon Trujillo

2018-07-17, 03:55 AM

2018-07-17, 04:21 AM

2018-07-17, 03:57 AM

0

1

Unconfirmed

Minecraft 1.13-pre9

-