Jump to content

[1.12] [Solved] Keeping mobs spawned and active away from the player


Kinniken

Recommended Posts

Hi guys,

 

My mod (Millénaire, for those who remember) depends heavily on keeping mobs active far away from the player (on loaded chunks of course). In 1.12 I'm having difficulties with this, Minecraft tends to freeze or even despawn my villagers when the player is 100 meters away or so, and if the player loads the game with villagers beyond that range they don't respawn even if the chunk is active.

 

Is there any way to force this?

 

Thanks

 

K.

Edited by Kinniken
Link to comment
Share on other sites

This is a common problem in most large games. It is very difficult to keep performance up if all the logic for all the things you cannot see is still running. Most games need to deactivate complicated objects that are "off screen". Minecraft uses this technique in many ways. For example, whole chunks get unloaded when possible. Entities can be unloaded as well, and even if they are still running on the server they will stop "tracking" (sending packets to the client) beyond a certain distance. Some of these things can be overridden a bit, for example the tracking range. 

 

I would start by seeing if using the Minecraft methods can help you. I would first make sure that the entities are registered with a very long (like 8000) tracking range. Secondly I would us the enablePersistence() method on your entities to prevent despawning. Just keep in mind that if you do this a lot it will cause performance issues. 

  • Like 1

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

I know the theory of it, I've been battling with it since Minecraft 1.4 :) And yes this means Millénaire is a very CPU-demanding mod, especially if you set it up with a large activity radius. Still, it's a worthwhile compromise for many players, and in fact one of the most requested feature ever is a way to keep villages running permanently even if the player is really far away (on the converse, you can also set it up so that only villages within say 100 meters are active).

 

I'll check that enable persistence feature but if it's about persisting entities when a chunk is reloaded I already have that. That tracking range might be more what I'm looking for, thanks.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.