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?

marked as duplicate by Virusbomb, Gigazelle, arghtype, Nelson, Lore Friendly Jul 10 at 4:24

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

Not enough escaping.

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