mojira.dev
MC-175294

Persistent zombies will build up over periods of time

We have a server that is years old, and once every few months we have to do maintenance on it because sometimes a random mob will die, or for one reason or another will produce an item. Then, a zombie picks up that item, causing it to become permanent. So, to combat this, we have to do a /kill on each of the hostile mob types, followed by a /kill @e[type=item]. This only gets the loaded areas, so it's still difficult.

Just because a skeleton stepped in some lava flow shouldn't be the reason a zombie now is carrying a bone in its hand and is forever wandering the server now. I'd propose a fix of tracking where an item originates, and only use items from a player, dropper, or dispenser to make a mob persistent when picking up items.

Expected behavior: Mobs should despawn when left alone and not interacted with deliberately by a player.

Current behavior: Zombies (and other mobs) can become persistent on their own by picking up random items dropped by mobs that happen to die on their own, preventing them from ever despawning in the first place.

Related issues

Attachments

Comments

migrated
[media][media]
GoldenHelmet

This is also an issue in Bedrock Edition, but over there it can break mob farms (MCPE-125111, MCPE-60552).

Avoma

Zombies, Zombie Villagers, Husks, and Drowned will no longer pick up glow ink sacs as of 1.17.1 Pre-release 1.

migrated

As a potential solution, zombies (drowned, husks, zombie villagers) may ignore the natural mob drops, as the mob may randomly die in a cave at any point. There is no reason to prevent blocks from being picked up as they aren't going to be dropped without the player's input. Since the glow ink sac is already ignored by zombies, implementing this fix shouldn't be hard or take much time. Here's the list of items which should be ignored by zombies, based on mobs that are quite common in caves:

  1. Rotten Flesh

  2. Bones

  3. Arrows

  4. Gunpowder

  5. String

  6. Slime Balls

  7. Ender Pearl

  8. Eggs, Raw Chicken, Feathers (baby zombie chicken jockey)

  9. Ink Sac (squids may also spawn in open underwater ravines, causing their drop to be washed inside of caves, potentially being picked up by zombies)

The following factors may cause the death of a mob:

  • Lava/fire

  • Falling on top of dripstone

  • Getting pushed off the edge by another mob (fall damage)

  • Suffocation (fish, squid)

While being rare enough to not be considered a problem, the mobs are going to eventually die and get their loot dropped, zombies on hard difficulty have a high chance of being able to pick up items from the ground. It would be especially noticable on servers and inside of spawn chunks which are always loaded.

EDIT: Also new axolotls attack squids, fish, drowned. This will eventually cause zombie overpopulation to occure for sure.

Potentially the following drop ignorance should also be considered, although these are unlikely to cause issues:

  1. Fish drops, including bone meal (fish can also be commonly washed into caves from ravines)

  2. Witch drops, although it is quite unlikely a witch is going to die on its own due to healing and fire resistance.

Brevort

This is still an issue in 1.17.1-pre1. Spider string seems to be most common because spiders repeatedly climb walls, fall, and kill themselves over time.

FaRo1

I had the idea of excluding all drops that can naturally occur as well, but the list is actually much longer:

  • arrow and bone

  • bamboo (panda)

  • wheat, seed, carrot, potato, bread, beetroot seed, beetroot (villager farming)

  • cactus

  • egg, feather, leather, raw and cooked beef, porkchop, chicken, mutton, rabbit, all the fish, all the wool

  • emerald, rabbit's foot, rabbit hide (fox)

  • ender pearl

  • glass bottles, glowstone, gunpowder, redstone, spider eye, sugar, stick

  • glow and regular ink sak

  • iron, poppy

  • rotten flesh, nautilus shell

  • ominous banner

  • (phantom membrane)

  • prismarine shards and crystals

  • string

  • scute, seagrass

  • slime

Excluding all of these items from being picked up by zombies would of course not be a good idea, it would just be a big guessing game whether a zombie just can't pick up items or whether you forgot something, every time you actually want to give them something. I didn't even list any drops here that can occur in limited amounts naturally, like flowers generating in the air and then updating or sandstone from a mob activating the desert temple TNT trap.

One possible proper fix would be to add a tag to items that says whether they were created by some natural process (mob dying from fall damage, cactus growing, etc.) and then not letting zombies become persistent when they pick up those items.

migrated

@Fabian I see no reason to disable block drops. They occure only during world generation or after the player input. Nether mobs are not going to cause any trouble, as the only way they can get to the overworld is with the player's input once again (except for naturally spawning zombie piglins inside of portals). TNT traps in temples only leave block drops for 5 minutes, at worst like 4 zombies will spawn there, I do not see this as an issue. All the above ground drops are not a problem too, as zombies will just burn to death or be spotted by the player. The issue here is more of a countless zombies in unexplored caves that player has no idea about until it starts to lag. Even considering all the broken block leftovers after world generation, new chunks are going to have a low frequency of mob spawns at first (I believe this is true, correct me if I'm wrong). Enough for all these items to disappear.

FaRo1

Good point with the Nether, you could technically say that players could consider that whenever they do anything Nether related. But my list was mainly just there to show that it's way too much that would have to be excluded and because it was fun to create and think about everything that is theoretically possible.

Here is the requested correction: Local difficulty does not affect the amount of mob spawns (except for zombie reinforcements). But it does affect how many zombies can pick up items.

migrated

Here's the reason why adding a tag for thrown items is a bad idea: it is simply a too complicated solution for such a simple issue. There are plenty of cases that would need to be addressed, such as block drops from player explosions, container drops, dropper thrown items, etc. It would take too much time for something as simple as mobs dying in caves that cause other mobs to never despawn. 

migrated

Not entirely sure if this is an issue which is exclusive to servers, but my god, this is such a massive issue on my server.

[media]
migrated

@Jacob some modified servers have an issue with zombie jockey chickens not despawning. Yes, this is technically the same issue, but you still should talk about it with plugin creators for your server - pretty sure eggs are specifically an issue with Spigot or Paper.

migrated

Affects 21w44a

migrated

This NEEDS to be fixed. I've got 10+ command blocks on a clock that are working to kill the mobs that are holding eggs. It's really quite unacceptable. 

Brain81505

This issue happens to me in 1.19.4. In my survival world, it has a cave fill with a bunch of zombies that hold bone, gunpowder, etc.

Jeuv

Still an issue in 1.21.

Jeuv

Can confirm for 1.21.4 and 1.21.5.

AceMcCrank

(Unassigned)

Community Consensus

Gameplay

Important

Mob behaviour, Mob spawning

1.15.2, 1.17 Pre-release 4, 1.17, 1.17.1 Pre-release 1, 1.17.1, 21w44a, 1.19.4, 1.21

Retrieved