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?

2

Not enough escaping.

{
  "type": "minecraft:item",
  "name": "minecraft:paper",
  "functions": [
    {
    "function": "set_nbt",
    "tag": "{display:{Name:\"{\\\"text\\\":\\\"Test\\\"}\"}}"
    }
  ]
}
| improve this answer | |
  • Thanks but can you tell me what is happening if you have the time? Thank you. – Lemon Jun 12 '19 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 '19 at 9:24
  • Thank you. It really helped. – Lemon Jun 12 '19 at 14:37
  • Can you accept it? – nift4 Jun 13 '19 at 4:43
0

Another solution:

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.