Sprawdź NBT na pozycjach Minecraft
//Item on the ground:
data get entity @e[type=item,limit=1,sort=nearest]
//Item in your hand:
data get entity @s SelectedItem
Nekå
//Item on the ground:
data get entity @e[type=item,limit=1,sort=nearest]
//Item in your hand:
data get entity @s SelectedItem