Since 19w45a?, hostile mobs which are located in lazy and non-ticking chunks do despawn, and they didn't previously, and that was useful for things like mob switches based on a mob spawner.
Note: it's expected for mobs to despawn if you would keep them fully loaded while walking away for more than 128 blocks, but previously, if you'd leave an area by a portal and keep hostile mobs in lazy chunks, they would stick around even if you'd be somewhere else in the same dimension. Not anymore.
Comments 3
Confirmed... I imagine the intent is what violine says, but to avoid removing functionality that is long-standing and absolutely necessary for some technical things, perhaps it could simply be applied to only mobs in the spawn chunks where this problem will be the most relevant. Elsewhere it should be a non-problem except when explicitly needed.
I imagine that this has been changed in order to prevent mobs in the lazy chunks to prevent any more mobs from spawning, see MC-155289.