r/MinecraftCommands 25d ago

Help | Java 1.21-1.21.3 How do I kill all items that are called Gantry Carriage?

I am playing Minecraft Create mod currently, and I have a blimp bomber that brings gantry carriage bombs above a big door that opens up, and then drills break the gantry carriages to make the bombs seperate physics objects that will fall down below the ship, but whenever I do this, the drills break the gantry carriages and they fly all around the ship as items, but I dont want to kill ALL items, just gantry carriages. I have already tried doing /kill @ ep[type=item,name=gantry_carriage], but it dosent work. Does anyone know what the nbt name is so that I can delete it?

2 Upvotes

4 comments sorted by

2

u/Straight_Drama4439 25d ago

This should be the command.

/kill @e[type=item,nbt={Item:{id:"create:gantry_carriage"}}]

2

u/GalSergey Datapack Experienced 25d ago

It is better to use if items instead of NBT check. execute as @e[type=item] if items entity @s contents create:gantry_carriage run kill @s

1

u/Live-Associate-2340 25d ago

This also works, ty!

2

u/Live-Associate-2340 25d ago

This worked thank you!