How to prevent mob despawning on death/teleportation? Sponge bug or expected behavior?

Spongevanilla 1.12.1 server (beta-322), but I’ve seen this behavior for sooooo long I can’t even remember how many Versions of MC back it has been. I never even stopped to think if it was the way the game worked or not anymore, and a player had noticed a disrepancy between playing with her sibling vs playing on her own and dying in battle (difference = chunks unloading or not)

If I am several hundred blocks away from spawn, and die as the result of a horde of mobs attacking me, if I die , respawn and immediately go /back (ie, nucleus plugin) all the mobs in the surrounding area are gone.

To eliminate the plugin factor, I stripped it right down to a naked spongevanilla server with a command block for teleporting to a fixed location about 400 blocks away from the spawn location, put a few mobs inside of a sun-sheltered box, killed myself, then pushed the button within 1-2 seconds to teleport back, and the mobs are gone. Not invisible, they do not reappear after logging out and in - they are gone.

That mechanism does not happen in the same map, same setup, when I launch just the minecraft 1.12.1 server jar , only the spongevanilla.


I suspect it has something to do with the optimization settings for sponge to cut down on entity management, but don’t believe that destroying all mobs in an unloaded region RIGHT AWAY is the intention especially when there are options that specify soft-and-hard despawn ranges and such.

IS THIS INDEED THE EXPECTED RESULT for sponge to impose on the server, as a result of its under the hood optimizations? Or is this a setting gone wild, or being ignored? Note that I am either hitting a teleportation command block within 0.5 to 2 seconds of respawning, or simply teleporting from one location to another, or teleporting away from mobs to a test location, then back to the mobs again right away within 1-2 seconds I am not twiddling my thumbs for a minute before heading back!!!

Entity section of global.conf:

entity {
        # Number of colliding entities in one spot before logging a warning. Set to 0 to disable
        collision-warn-size=200
        # Number of entities in one dimension before logging a warning. Set to 0 to disable
        count-warn-size=0
        # Number of ticks before a painting is respawned on clients when their art is changed
        entity-painting-respawn-delay=2
        # Number of ticks before the fake player entry of a human is removed from the tab list (range of 0 to 100 ticks).
        human-player-list-remove-delay=10
        # Controls the time in ticks for when an item despawns.
        item-despawn-rate=6000
        # The upper bounded range where living entities farther from a player will likely despawn
        living-hard-despawn-range=128
        # The amount of seconds before a living entity between the soft and hard despawn ranges from a player to be considered for despawning
        living-soft-despawn-minimum-life=30
        # The lower bounded range where living entities near a player may potentially despawn
        living-soft-despawn-range=32
        # Max size of an entity's bounding box before removing it. Set to 0 to disable
        max-bounding-box-size=1000
        # Square of the max speed of an entity before removing it. Set to 0 to disable
        max-speed=100
    }

My entire global.conf file is located here:
https://pastebin.com/m0jCQXb9

I had deleted the /worlds folder entirely before starting testing, and did not alter any of the conf files for the dimensions.
Note as well my testing was limited to teleportation within the overworld main world only too, not across dimensions.


Hopefully someone like @blood etc can provide some insight here?

The first thing I suggest to test is to disable some optional modules in the config
try with
entity-activation-range=false
optimizations=false
This’ll help to narrow down where the issue is coming from.