How do I restore entities in Minecraft?

First off: Don't panic - it's probably not as bad as you think it is.

The /kill command only kills entities in loaded chunks, so your villagers are safe if the chunks that the village is in were not loaded when you ran the command. Similarly for the Ender Dragon, if nobody was in The End when you ran the command, it'll still be alive.

Secondly: Let this be a lesson learned - don't forget to make regular backups of your world!


I verified this by spinning up a brand new 1.14.4 world, finding a village (to make sure it had living villagers in it in the first place) and then moving far enough away to unload the village chunks, then running the following:

/kill @e[type=!minecraft:player]

I then moved back to the village and could see the villagers still wandering around and very much alive.

If your village was loaded at the time, then you will have killed all of the villagers there, but that's not the end of the world. You have several options open to you for repopulation. The easiest thing to do would be to give yourself some villager spawn eggs via the /give command (or pulling them from the creative mode inventory):

After version 1.13 the syntax would be:

/give @p minecraft:villager_spawn_egg COUNT

Where COUNT is the number of eggs to give yourself. You can then simply spawn a new batch of villagers with them.

Alternatively you could purify some Zombie Villagers and repopulate that way, or you could move some villagers from another village using minecarts.


For further peace-of-mind, I also ran the following from the Overworld:

/kill @e[type=minecraft:ender_dragon]

This results in a console error: No entity was found - another confirmation that entities in unloaded chunks cannot be killed using the /kill command.