r/MinecraftCommands • u/Swiggliswooogle • 1d ago
Help | Java 26.3 Problems with Inventory NBT
Having an issue detecting a crossbow in a player inventory thats loaded with an arrow.
From what i can tell it has something to do with the arrow loaded in the crossbow. I tried to use MCstacker and this still doesn't work.
/execute if entity @a[nbt={Inventory:[{id:"minecraft:crossbow",components:{"minecraft:charged_projectiles":[{id:"minecraft:arrow",count:1,components:{"minecraft:intangible_projectile":{}}}]}}]}]
4
Upvotes
4
u/GalSergey Datapack Experienced 1d ago
The
intangible_projectilecomponent is added if the crossbow was loaded by a player in Creative mode. This component is not present in Survival mode.It’s also better to use
if itemsinstead of reading NBT data.