I would like to know how I would be able to kill a player near an armor stand, then kill the armor stand and use the explosion particle at the same time. I'm working on a single command for a claymore and I need it to explode.

I have tried doing this command a couple times but it only killed me when I was near the command block. The command I used is /kill @p[r=2] [type=ArmorStand,Name=Clamore] and other versions of this with minor changes.


You will need to put the /kill command into a /execute:

/execute @e[type=ArmorStand,name=Claymore] ~ ~ ~ /kill @a[r=2]

Put this into a repeat Command block and next to it place a Chain Command block with this command:

/execute @e[type=ArmorStand,name=Claymore] ~ ~ ~ /particle explode ~ ~ ~ <xd> <yd> <zd> <speed> <count>

Example of the /particle command: /particle explode ~ ~ ~ 5 5 5 0.1 200 will generate 200 smoke particles around the player within a radius of 5 at a speed of 0.1.

Next to the 2nd Command block place another Chain Command block with this commmand:

/kill @e[type=ArmorStand,name=Claymore]

So, altogether this will look like this:


Where the left Command block has the 1st command listed above, the middle one the 2nd and the right one has the 3rd.

| improve this answer | |

/kill only works with one argument at a time. What this means is that you can only kill one type of entity at once.

In this case, you need to run:

  1. /kill @p[r=2] first to kill the player, then
  2. /kill @e[type=ArmorStand,Name=Clamore] to remove the armor stand, then
  3. a command to generate the particles (use this as a reference for the command in question).
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.