1

The zombies are supposed to drop a piece of paper named "Test" but it just screws up the whole zombie drop and not dropping anything at all.

Here is the part where the zombie is going to drop a named piece of paper:

{
  "type": "minecraft:item",
  "name": "minecraft:paper",
  "functions": [
    {
    "function": "set_nbt",
    "tag": "{display:{Name:"{\"text\":\"Test\"}"}}"
    }
  ]
}

Is there something wrong with the code?

0

2 Answers 2

2

Not enough escaping.

{
  "type": "minecraft:item",
  "name": "minecraft:paper",
  "functions": [
    {
    "function": "set_nbt",
    "tag": "{display:{Name:\"{\\\"text\\\":\\\"Test\\\"}\"}}"
    }
  ]
}
2
  • Thanks but can you tell me what is happening if you have the time? Thank you.
    – Lemon
    Jun 12, 2019 at 7:08
  • You probably copied the nbt data fron the chat, and in the Chat the NBT data isn't in abother String. (Here tag). So here needs extra escaping.
    – nift4
    Jun 12, 2019 at 9:24
0

Another solution:

{
    "type": "minecraft:item",
    "name": "minecraft:paper",
    "functions": [
        {
            "function": "set_nbt",
            "tag": "{display:{Name:'{\"text\":\"Test\"}'}}"
        }
    ]
}

Not the answer you're looking for? Browse other questions tagged .