How do I keep a zombie from despawning, since nametags apparently aren't working for me?

How do I keep a zombie from despawning, since nametags apparently aren't working for me? - Free stock photo of alphabet, be a self starter, blur

I'm making an adventure map in Minecraft, and I want to keep zombies from despawning. I've already tried nametags, and they still despawn.



Best Answer

If, for whatever reason, nametags don't keep a Zombie from naturally despawning, you can use some NBT magic to do the trick. Each and every Living Entity (aka Mob) has the NBT tag PersistenceRequired of the type boolean. This tag does exactly what you want to achieve.

The MinecraftWiki states the following:

PersistenceRequired: 1 or 0 (true/false) - true if the mob must not despawn naturally.

Source: http://minecraft.gamepedia.com/Chunk_format

Applying that tag to a Zombie can be done in two ways:

1. Summon a new Zombie
/summon Zombie ~ ~ ~ {PersistenceRequired:true}
Of course, you can edit the co-ordinates to whatever fits your needs. The tildes (~) are relative co-ordinates, thus representing the position of the executing player or command block.

2. Edit the entity data of an existing Zombie
/entitydata @e[type=Zombie,r=3,c=1] {PersistenceRequired:true}
For this command to work, the Zombie must be within three blocks in a spherical radius of who- or whatever executes the command (r=3). Of course, you can easily edit that parameter. This command also selects only the nearest Zombie to you or the respective command block (c=1). You can omit the count (c) parameter if you want to do this for every Zombie within the given radius.




Pictures about "How do I keep a zombie from despawning, since nametags apparently aren't working for me?"

How do I keep a zombie from despawning, since nametags apparently aren't working for me? - Photo of Woman Taking Notes
How do I keep a zombie from despawning, since nametags apparently aren't working for me? - Man and Woman Sitting on Black Wooden Bench
How do I keep a zombie from despawning, since nametags apparently aren't working for me? - Woman in White Crew Neck T-shirt and Blue Denim Jeans Working on a Laptop



How do you make a zombie not Despawn without name tags?

Name tags outside creative mode can be found in treasure chests, or as rare loot when fishing (not actually so rare if using "luck of the sea" enchanted fishing rod). You rename them using the anvil, and then apply to given mob. Once named, the mob will not despawn.

How do I stop my zombies from Despawning?

Name tags. Perhaps the best way to keep mobs from despawning is through the use of name tags. These items are rare and can be difficult to find, but naming mobs with a name tag is the most surefire way to ensure that they will never despawn.

Will a zombie with a nametag Despawn?

A villager with a name tag turned into a zombie villager by a zombie with a name tag does not despawn, but a villager with a name tag turned into a zombie by a zombie without a name tag does despawn.

Do mobs Despawn if they are named?

A renamed mob won't despawn. Mobs in the presence of a player in Spectator Mode will not despawn as they would in other circumstances. Most hostile mobs will despawn if the difficulty is set to "peaceful".



Minecraft How To STOP Mobs From Despawning Tutorial




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Brett Jordan, Ivan Samkov, cottonbro, Anna Shvets