Minecraft Java Edition – How to Remove All Minecarts on a Specific Block Using Commands

minecraft-commandsminecraft-java-edition

I am working on my "Minecart Elevator" and I need to kill all the minecarts on a specific block. I have tried many methods, but none of them work. There is no track below the minecarts. How should I do this?

Best Answer

I found it. At https://gist.github.com/Dinnerbone/3736487, there is information stating that to target entities at a block, you use:

@e[4,4,4,r=your_radius,type=MinecartRideable,tag=value...]

where 4,4,4 are your x y and z, and your_radius is your radius.