NBT data as command output has incomplete String escaping
Introduction
When a command modifies or for some commands also not modifies the NBT data of an entity or a block, the chat shows the current NBT data.
The bug
I noticed a bug after recompiling Minecraft 1.8 using MCP which is still present in the latest version. When the toString() method of a NBTTagString is called, it only replaces double quotes (") with escaped double quotes (\").
This can cause problems as the output is supposed to represent the correct NBT data of an object. As it is missing the backslash escaping it would cause two backslashes to become one.
How to reproduce
- Use the following command:
/summon armor_stand ~ ~ ~ {CustomName:"\"\\a"} - Use the following command:
/entitydata @e[type=armor_stand,c=1] {CustomNameVisible:1b}
The output probably shows something like this:
...CustomName:"\"\a"...
But as you see that was not what you entered.
Created Issue:
NBT data as command output has incomplete String escaping
Introduction
When a command modifies or for some commands also not modifies the NBT data of an entity or a block, the chat shows the current NBT data.
The bug
I noticed a bug after recompiling Minecraft 1.8 using MCP which is still present in the latest version. When the toString() method of a NBTTagString is called, it only replaces double quotes (") with escaped double quotes (\\\").
This can cause problems as the output is supposed to represent the correct NBT data of an object. As it is missing the backslash escaping it would cause two backslashes to become one.How to reproduce
- Use the following command:
/summon ArmorStand ~ ~ ~ {CustomName:"\"\\a"}- Use the following command:
/entitydata @e[type=ArmorStand,c=1] {CustomNameVisible:1b}The output probably shows something like this:
...CustomName:"\"\a"...But as you see that was not what you entered.
Introduction
When a command modifies or for some commands also not modifies the NBT data of an entity or a block, the chat shows the current NBT data.
The bug
I noticed a bug after recompiling Minecraft 1.8 using MCP which is still present in the latest version. When the toString() method of a NBTTagString is called, it only replaces double quotes (") with escaped double quotes (
\\\").
This can cause problems as the output is supposed to represent the correct NBT data of an object. As it is missing the backslash escaping it would cause two backslashes to become one.How to reproduce
- Use the following command:
/summon ArmorStand ~ ~ ~ {CustomName:"\"\\a"}- Use the following command:
/entitydata @e[type=ArmorStand,c=1] {CustomNameVisible:1b}The output probably shows something like this:
...CustomName:"\"\a"...But as you see that was not what you entered.
Introduction
When a command modifies or for some commands also not modifies the NBT data of an entity or a block, the chat shows the current NBT data.
The bug
I noticed a bug after recompiling Minecraft 1.8 using MCP which is still present in the latest version. When the toString()
method of a NBTTagStringis called, it only replaces double quotes (") with escaped double quotes (\").
This can cause problems as the output is supposed to represent the correct NBT data of an object. As it is missing the backslash escaping it would cause two backslashes to become one.How to reproduce
- Use the following command:
/summon ArmorStand ~ ~ ~ {CustomName:"\"\\a"}- Use the following command:
/entitydata @e[type=ArmorStand,c=1] {CustomNameVisible:1b}The output probably shows something like this:
...CustomName:"\"\a"...But as you see that was not what you entered.
Introduction
When a command modifies or for some commands also not modifies the NBT data of an entity or a block, the chat shows the current NBT data.
The bug
I noticed a bug after recompiling Minecraft 1.8 using MCP which is still present in the latest version. When the toString() method of a NBTTagString is called, it only replaces double quotes (") with escaped double quotes (\").
This can cause problems as the output is supposed to represent the correct NBT data of an object. As it is missing the backslash escaping it would cause two backslashes to become one.How to reproduce
- Use the following command:
/summon ArmorStand ~ ~ ~ {CustomName:"\"\\a"}- Use the following command:
/entitydata @e[type=ArmorStand,c=1] {CustomNameVisible:1b}The output probably shows something like this:
...CustomName:"\"\a"...But as you see that was not what you entered.
Introduction
When a command modifies or for some commands also not modifies the NBT data of an entity or a block, the chat shows the current NBT data.
The bug
I noticed a bug after recompiling Minecraft 1.8 using MCP which is still present in the latest version. When the toString() method of a NBTTagString is called, it only replaces double quotes (") with escaped double quotes (\").
This can cause problems as the output is supposed to represent the correct NBT data of an object. As it is missing the backslash escaping it would cause two backslashes to become one.How to reproduce
- Use the following command:
/summon ArmorStand ~ ~ ~ {CustomName:"\"\\a"}- Use the following command:
/entitydata @e[type=ArmorStand,c=1] {CustomNameVisible:1b}The output probably shows something like this:
...CustomName:"\"\a"...But as you see that was not what you entered.
Introduction
When a command modifies or for some commands also not modifies the NBT data of an entity or a block, the chat shows the current NBT data.
The bug
I noticed a bug after recompiling Minecraft 1.8 using MCP which is still present in the latest version. When the toString() method of a NBTTagString is called, it only replaces double quotes (") with escaped double quotes (\").
This can cause problems as the output is supposed to represent the correct NBT data of an object. As it is missing the backslash escaping it would cause two backslashes to become one.How to reproduce
- Use the following command:
/summonArmorStand ~ ~ ~ {CustomName:"\"\\a"}- Use the following command:
/entitydata @e[type=ArmorStand,c=1] {CustomNameVisible:1b}The output probably shows something like this:
...CustomName:"\"\a"...But as you see that was not what you entered.
Introduction
When a command modifies or for some commands also not modifies the NBT data of an entity or a block, the chat shows the current NBT data.
The bug
I noticed a bug after recompiling Minecraft 1.8 using MCP which is still present in the latest version. When the toString() method of a NBTTagString is called, it only replaces double quotes (") with escaped double quotes (\").
This can cause problems as the output is supposed to represent the correct NBT data of an object. As it is missing the backslash escaping it would cause two backslashes to become one.How to reproduce
- Use the following command:
/summon armor_stand ~ ~ ~ {CustomName:"\"\\a"}- Use the following command:
/entitydata @e[type=armor_stand,c=1] {CustomNameVisible:1b}The output probably shows something like this:
...CustomName:"\"\a"...But as you see that was not what you entered.

Confirmed.
Edit: Needed a second look
since backslashes are used for escaping quotes, the backslash after the \" is escaping the backslash after that one; however this is an odd behaviour as it doesn't remove the backslash from the \"
Yes, but when the command used is
{CustomName:"\"\\a"}then the output of the entitydata should be
...CustomName:"\"\\a"...and not
...CustomName:"\"\a"...yeah, I got that, is just an odd behaviour in general
Yes, this is caused by the toString() method in net.minecraft.nbt.NBTTagString (MCP 9.24 beta names):
Another example:
place an empty sign and use
/blockdata x y z {}The output will say
{Text1:"{"text":""}",Text2:"{"text":""}",Text3:"{"text":""}",Text4:"{"text":""}"}Was fixed in 1.12 or before