How do I detect when an item is on top of a specific block?
I've been all around Google trying to find this out. I am making a data pack with a custom crafter and I have the summon command all ready. I want to be able to throw a diamond block on top of a blast furnace and turn it into the crafter.
The command:
Run this command every tick (or every second to save on lag)
execute as @e[type=item,nbt={Item:{id:"minecraft:diamond_block",Count:1b}}] at @s if block ~ ~-1 ~ minecraft:blast_furnace run function namespace:summon_crafter
How it works:
execute as @e[type=item,nbt={Item:{id:"minecraft:diamond_block",Count:1b}}]
Runs the rest of the command as all item entities that are a single diamond block.
at @s
Runs the command at the location of any detected diamond blocks
if block ~ ~-1 ~ minecraft:blast_furnace
Check if the block underneath it is a blast furnace
run function namespace:summon_crafter
Summon your crafter