Note: This issue is also reported for Java Edition at MC-175294. There it seems to be a mere annoyance rather than a farm-killer because of the differences in spawning mechanics between the editions.
Despawn-immune monsters can accumulate in areas the player has never visited and cannot easily find, such as hidden caves and small surface pools. Over time they fill the monster population caps and prevent further spawns. This is despite the despawning changes in 1.16.0 that were meant to fix this problem (MCPE-21856, MCPE-34032). The cause of the issue now is the fact that mobs become persistent when they pick up items. This can happen without player interaction. In particular:
Monsters in hidden caves can drown or be burned by lava and drop items, which are then picked up by zombies.
Monsters on the surface can burn or fight each other (e.g. if skeletons or trident-wielding drowned attack naturally-spawned iron golems, or trident-wielding drowned attack villagers, and accidently hit another mob, starting a fight), or be killed by naturally-spawned iron golems, and drop items which are then picked up by zombies.
A zombie can spawn with armor and the ability to pick up items, walk into a pool, drop its armor when it drowns (MCPE-33140), and immediately pick up its armor again (MCPE-89100), becoming a persistent drowned. When a surface-cap zombie drowns it becomes a cave-cap drowned (MCPE-61721), allowing an infinite number of drowned to build up (MCPE-34032). It is also possible for skeletons or other drowned to pick up armor dropped by drowning zombies.
Steps to reproduce
Create an infinite world, creative mode, with difficulty set to "hard".
Afk for 24 hrs somewhere in a non-ocean biome the overworld where there are caves and 2-deep pools.
/tp ~ 255 ~ to despawn monsters.
/execute @e[type = !player] ~~~ say hi
Expected results
"No targets match selector."
Actual results
[Zombie] "hi"
[Drowned] "hi"
Related issues
discovered while testing
is duplicated by
Attachments
Comments


The attached test world,
[media], can also be used to reproduce this bug. It consists of an 80 x 80 platform with 9 4x4 pools that monsters can wander into. The player stands on top of a pillar in the middle. I went afk for about 25 minutes to test (midnight, daylight cycle off) and had 2 persistent drowned at the end of that time.

As requested in MCPE-60552, my seed is 538239489.
The witch hut is at [1235, 1603]
The persistent spawns I checked in the area were are listed in the table below:
Notes:
There were a lot more more found that I did not check. They will be visible in the image, but not listed here.
A "Y" value of "hole" means it was a water-filled hole accessible from the surface.
"Zombie" includes Zombie Villagers.
Only the ones within 4.5 chunk offset (measured from center of witch farm chunk) contributed to the population cap. I had the position slightly off in the attached screenshot (see below) from MCPE-60552, causing my outlined area to be one chunk too far West. With it in the correct position, the number of persistent mobs in the 9x9 population cap area was 11, not 9. Correct numbers used below.
X | Y | Z | Description | X offset (chunks) | Y offset (chunks) | Max offset (chunks) |
---|---|---|---|---|---|---|
1236 | 20 | 1591 | 1 x Zombie holding Gunpowder | 1.06 | 1.09 | 1.09 (in density cap) |
1220 | 22 | 1603 | 1 x Zombie holding Rotten flesh? Gravel? | 0.31 | 1.28 | 1.28 (in density cap) |
1230 | 50 | 1653 | 2 x Drowned | 2.81 | 2.88 | 2.88 (in density cap) |
1226 | hole | 1664 | 4 x Drowned | 3.5 | 3.6 | 3.6 (in density cap) |
1307 | 30 | 1593 | 2 x Zombie holding Arrow, Rotten Flesh | 0.93 | 4.29 | 4.29 (in density cap) |
1308 | 30 | 1591 | 1 x Zombie holding Slime | 1.06 | 4.38 | 4.38 (in density cap) |
1257 | hole | 1685 | ~40 x Drowned! 1 x Zombie holding Wool? | 4.81 | 4.92 | 4.92 |
1221 | hole | 1702 | 8 x Drowned in a water filled hole | 5.87 | 5.99 | 5.99 |
1153 | 45 | 1540 | 1 x Drowned holding Rotten flesh | 4.25 | 6.9 | 6.9 |
1128 | 30 | 1635 | 2 x Zombie holding Bone, Arrow, not in water! | 1.68 | 7.2 | 7.2 |
1125 | hole | 1537 | 6 x Drowned, 1 x Illager in a water filled hole | 4.43 | 8.44 | 8.44 |
1156 | 11 | 1499 | 1 x Zombie holding Cooked mutton | 6.81 | 8.6 | 8.6 |
1111 | 33 | 1684 | 1 x Zombie holding Gravel | 4.75 | 9.35 | 9.35 |
1009 | 20 | 1621 | 1 x Zombie holding Arrow | 0.81 | 14.46 | 14.46 |
Here is a screenshot illustrating the positions after quite a few of the Zombies were killed (and the ~40 Drowned). See MCPE-60552 for a full description. Again, note that the outlined area is one chunk too far West so one drowned is incorrectly included and 3 zombies are not marked.
[media]
Other ways for items to be dropped without player interaction:
Mobs killed by lightning.
Unsupported gravel/sand from world generation getting updated by flowing water/lava (only on first load only when water/lava is in the process of flowing)?
I've often seen patches of broken kelp, and sometimes broken blocks (gravel?) floating in the ocean on my way through an area. I have no idea what caused this, except possibly unsupported gravel getting updated (making it the same issue as the last one), but it could lead to drowned holding items in open water areas.
There are also quite a few ways with indirect player interaction simply by not picking up all player-caused dropped items. The hardest of these to avoid would be:
Decaying leaves after chopping down a tree.
Breaking blocks near a cave opening or ravine. They could be carried in deeper by flowing water.
Player death when you can not find your corpse (although, hopefully this doesn't happed that often!)
It's annoying enough picking up all the easy drops, like from killed mobs, or unwanted items from mining. It's nice to just be able to throw unwanted items on the ground without worrying that you might be creating a persistent mob that will give you headaches later.

I would guess that mobs are given persistence when they pick up items so that if a player dies and a mob takes the items, then the items will not be lost due to the mob despawning. It might be better to instead to give mobs 5 minutes of despawn immunity when they pick up items (to match the 5 minute item despawn timer).

Could also just have the mob drop any picked up items on despawn. Or both.

The new glow ink sac made zombie persistence more common, as glow squids tend to die in caves. In Java, zombie variety mobs cannot pick up glow ink sac, but this is not the case on Bedrock edition, and I hope that gets fixed.
Wandering traders spawning and dying in caves can also accumulate zombies carrying leads, and a lot of trader llamas that don't seem to despawn.

I decided to copy my world, and set it to creative, to see what's causing lag around my base. Here are some of the things I found:
-A cave with water containing a bunch of persistent drowned with armor. Zombies with armor must have drowned here, and the new drowned picked up the armor worn previously, causing persistence.
-A ton of trader llamas underground, and zombies holding leads. All that collision with 30+ llamas and zombies are causing a bit of lag.
-Zombies holding arrows, bone, gravel, slime, glow ink sac, etc. Somehow skeletons etc are dying in caves.
I think the solution is obvious: simply allow zombies (and all their variants) to despawn even if they're holding items, or equipping new armor. Maybe if they're actually holding something valuable, they can have persistence, if that check doesn't cause lag? Also, trader llamas that players haven't interacted with should just despawn eventually.
Edit: as of 1.18, zombies are also carrying Azalea material in lush caves. Water destroys lush cave stuff, and zombies will pick them up, causing persistence upon generation.

Trader llama buildup is tracked at MCPE-102302.
Tested again in the latest beta, and Glow Ink Sacs will no longer be picked up by zombies/zombie villagers/husks/drowned in 1.17.30

This is a very impactful issue for not only mob farms but also general game play. Hostile mobs are rare to find when exploring caves after the first few hours of play in an area. Boosting the cave cap doesn't solve the problem because the extra cap is still used up by the hidden persistent mobs after a while.

As a work around, to help find the monsters that are causing lag issues you can modify the commands above (in a creative copy)
tp ~ 319 ~
/execute @e[type = !player] ~~~ fill ~ ~2 ~ ~ 319 ~ stained_glass 0
Use the glass pillars that formed to find the problem areas, record those coordinates, and then you can go back to your survival copy and clear them out and also do some spawn proofing

My witch hut stopped spawning witches recently. All bugs concerning witch huts that have stopped spawning witches seems to be "resolved " and are pointed to this issue. I've tried flying high in the air that should make all spawned mobs disappear. I've also turned my game from hard to peaceful and back again. Shouldn't both ways make all mobs despawn whether they are holding objects or not? I'll try copying my world and changing it to creative so I can see if caves are full of mobs that are below my witch farm.