TransWikia.com

What is the correct syntax for checking CustomName nbt in a loot table condition

Arqade Asked by Askyras on August 12, 2021

I have 2 different "types" of zombie, told apart by different CustomName tags assigned at spawn. I want them to have different loot tables too, but my current code simply removes all drops from zombies instead.

(file structure and the rest of the code is correct because it works when I’m not checking CustomName)

Example: "Drop gold if zombie is named "I-drop-gold"

{
  "type": "minecraft:entity",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:gold_ingot",
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": 1
            }
          ]
        }
      ],
      "conditions": [
        {
          "condition": "minecraft:entity_properties",
          "entity": "this",
          "predicate": {
            "nbt": "{CustomName:I-drop-gold}"
          }
        }
      ]
    }
  ]
}

Why doesn’t this work, what is the correct formatting?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP