3

I am using Spigot, some plugins, and I want to make like a zoo on a map, with mobs behind glass cubes. The problem is that when I load my map, every time some of the mobs just vanish, empty cages. I put eggs again, they spawn, I go to my other map in the multiverse (/mv tp my_other_map) and when I come back, empty cages again, always the same ones...

I've read it's a question of distance of me (distance in cubes unit), if I'm too far away, the mobs will despawn... Is there a way for them to stay?

  • I have removed the second question from this post. If you have multiple questions, ask multiple questions (This is not a forum, check out the tour as well!). You can still access what you have written in the revision history, by clicking on "edited X ago" below the question. (Or simply use this direct link to revision 1). – MrLemon Oct 16 '15 at 8:50
5

For question 1 (as they should really be two separate questions):

Mobs despawn if you are more than 32 blocks from them, as shown in this chart:

enter image description here

To stop a mob from despawning, you need to give it the PersistenceRequired NBT tag. You can do this when you summon the mob like this:

/summon Creeper ~ ~ ~ {PersistenceRequired:1b}

Or by changing the mob's data after summoning them:

/entitydata @e[r=10,c=1] {PersistenceRequired:1b}
  • Okay thank you for the quick answer. Being a noob a put the first command on my console, it worked but the creeper did not move (like it turned but did not walk) so i tried the same with 5b and it walked. Does that mean that the number is the number of step it can make around the spawn point? As for the second command I really did not understand it so i'm not going to play with it now (because of course creepers are not the only mobs I want to spawn) – Niko Oct 15 '15 at 18:00
  • @Niko PersistenceRequired is a boolean (only values of 1 and 0 are valid). If it's 1, then the mob does not respawn, as you wanted; it shouldn't restrict movement. You can just change the "Creeper" to "Skeleton" or whatever mob you want to spawn in the first command. – SirBenet Oct 15 '15 at 21:22
2

Just as an extra option to colorfusion's solution: putting a name tag on a mob will prevent them from despawning as if they were a tamed animal like a cow or chicken. This obviously does not work if the difficulty is set to peaceful as that will despawn the mobs,

-1

option 1 they dont have gravity option 2 they cannot move 18 blocks above or they will instantly disappear when they are too far option 3 like Gnarly 404 said get them nametags

  • Your answer is very confusing. What do you mean by "dont have gravity". There isnt a distance of 18 which does affect spawning/despawning(see colorfusions answer) – Mystery Oct 25 '15 at 23:41

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.