2

I am making a datapack that uses copper as a fuel, however part of that means that I need to be able to test an item when it is on the ground to see if it is one of the 37 copper items. I have already been able to make a #tags list that I have called #copper, enter image description here which works as intended.

The problem is, I have found no way of matching an entity against the tag. I was sent towards predicates, however I was unable to get it to accept multiple items or matched NBT to tags.

Here is the predicate I created using an online generator, but while the predicate appears in-game, it always returns false.

  {
    "condition": "minecraft:entity_properties",
    "entity": "this",
    "predicate": {
      "nbt": "{Item:{id:\"minecraft:copper_ingot\"}}"
    }
  },
  {
    "condition": "minecraft:entity_properties",
    "entity": "this",
    "predicate": {
      "nbt": "{Item:{id:\"minecraft:copper_block\"}}"
    }
  },
  {
    "condition": "minecraft:entity_properties",
    "entity": "this",
    "predicate": {
      "nbt": "{Item:{id:\"minecraft:raw_copper\"}}"
    }
  }
]

As an additional problem, I know I will also need to check a list a return a number based on what item I find. ie, "copper_ingot" returns 1, "copper_block" returns 9. For this problem I have no idea where to even begin.

0

You must log in to answer this question.