0

I'm working on a treeAxe using commands in 1.18, but I can't figure out how to tag items that are logs and wood.
Here is what have so far:

tag @e[type=item,nbt={item:{id:"minecraft:acacia_log"}}] add log
1
  • What exactly are you attempting to do with this? My Hope is you are not trying to Target the blocks but the dropped items instead, because if I am right then we can try to figure out what's going wrong, but if I am wrong then what you are trying to do isn't currently possible without mods 😅
    – DeJeL
    Apr 18, 2022 at 7:12

1 Answer 1

1

This is the command:

execute as @e[type=item,nbt={Item:{id:"minecraft:oak_log"}}] unless entity @s[tag=log] run tag @s add log

This command will detect any item that is of type oak_log, so you would need to repeat this one for every log type.

The unless part makes the command block only add the tag to logs that aren't tagged already, reducing lag.

You must log in to answer this question.

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