0

I want prevent the block drop for banners if the contain a specific banner pattern combination. I know there is the loot table condition location_check which can test the NBT of a block but I’m unsure about the right syntax. Do I need to specify the complete NBT of the block or is it sufficient to only provide a part of the nbt?

So condition so far:

"conditions": [
    {
      "condition": "minecraft:location_check",
      "predicate": {
        "block": {
          "nbt": "{Patterns: [{Pattern: \"gra\", Color: 9}, {Pattern: \"cbo\", Color: 14}, {Pattern: \"glb\", Color: 15}, {Pattern: \"bts\", Color: 5}]}"
        }
      }
    }
  ]

1 Answer 1

0

To create a loot table condition that prevents a block from dropping based on its NBT data, you can use the minecraft:location_check condition. But as you said, you want to check if a banner has a specific pattern combination. It's possible to specify only part of the NBT data, which allows you to match specific patterns without defining the entire NBT structure of the block.

Yo please try this one:

"conditions": [
    {
      "condition": "minecraft:location_check",
      "predicate": {
        "block": {
          "nbt": "{BlockEntityTag:{Patterns:[{Pattern:\"gra\",Color:9},{Pattern:\"cbo\",Color:14},{Pattern:\"glb\",Color:15},{Pattern:\"bts\",Color:5}]}}"
        }
      }
    }
  ]

This condition will prevent the block drop for banners if they contain the specified banner pattern combination. Please replace the Pattern and Color values with your banner pattern combination.

2
  • somehow this doesn't work, if i remove (only) the predicate, this loot table work as expected and picks on the two entries. But not with block predicate. Other predicates like checking for biome work. Commented Jun 14 at 14:13
  • Still i can't get it to work. The data of placed banner: [System] [CHAT] 127, 64, 18 has the following block data: {x: 127, y: 64, z: 18, id: "minecraft:banner", Patterns: [{Pattern: "gra", Color: 9}, {Pattern: "cbo", Color: 14}, {Pattern: "glb", Color: 15}, {Pattern: "bts", Color: 5}]} Commented Jun 19 at 12:27

You must log in to answer this question.

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