Minecraft – How to kill all mobs of a certain type in a radius and summon a new named mob

minecraft-commandsminecraft-java-edition

For my server I want to have special items, and I've already looked up all the commands for the entities to work but I found a flaw with one – all entities within the radius change. Is it possible to kill all entities within a radius (shot by a specific named item) and /summon a named mob in its place? Basically:

  • Shoot bow/snowball
  • Kill shot arrow/snowball from named bow/snowball within a radius of 1 for all players (with /execute)
  • Summon a named arrow/snowball

How would I do this?

Best Answer

Ok so this is for summoning an immobile arrow:

Add a repeating command block (always active) with the following command:

/execute @e[type=Arrow] ~ ~ ~ /summon Arrow ~ ~ ~ {CustomName:NAMEHERE}

Add a chain command block to the back of the repeating command blockthats always active and conditional

/execute @a ~ ~ ~ /kill @e[type=Arrow,r=4]

Your question is unclear

The arrow will not move. It would require hundreds, at the very least, of command blocks. Nevertheless, I wish you luck. I could try to improve it if I could get on your server but I will not be able to make it perfect.