#how would I make it if a item is thrown into another item both are deleted and a function happens?
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
💬 While you wait, take this time to provide more context and details.
🙇 If nobody has answered you by <t:1740865432:t>, feel free to use the Summon Helpers button to ping our helper team.
✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve
Run a command in your ticking function as all item entities, that checks what item they are, and if they are one of the desired items, runs a function
Your question, #1345504335609466920 (how would I make it if a item is thrown into another item both are deleted and a function happens?), was resolved!
#1345504335609466920 message
3m
I kinda understand this but can you show me an example?
Try writing it yourself and we'll help from there
i came up with this command but I don't think it's correct :[
execute as @e[type=item,nbt={Item:{id:"minecraft:cobblestone"}},name=erd] at @s if entity @e[type=item,distance=..1,nbt={Item:{id:"minecraft:stick"}}] run kill
why u killing @itsroscuro with it lol
name=erd is detecting if the entity is called erd, I assume you are trying to detect an item itself called erd?
Yeah!
Item name is an item component, so it would be written like this,
@e[type=item,nbt={Item:{id:"minecraft:cobblestone",count:1,components:{"minecraft:item_name":'"erd"'}}}]
(also I put count:1 for more precision for only 1 item, but you can remove that if you like)
But, if its a custom name(eg. named on an anvil), then replace item_name with custom_name
You should also use if items rather than an NBT check in the item
This question has been inactive for some time, so it's going to be closed for inactivity. If you still need it, please disregard this message.