Workaround from [~GoldenHelmet]
I have created a behavior pack that allows trader llamas to follow normal despawn rules if they get separated from the wandering trader:
[media]
Note that using this will disable achievements in your world.
When the wandering trader despawns, there is a chance that the llamas won't despawn with him. If this happens, those trader llamas will never despawn, even when leaving the area and returning.
Attaching several screenshots all taken within two minutes of several llamas that have not despawned. Some of these have been around for several days.
Related issues
is duplicated by
Attachments
Comments


This is intentional unless if you made all the wandering trader's trades locked, they will despawn with the llamas.

Pretty sure it's not intentional. The world would slowly fill up with llamas that you can't interact with.

The same happens on Java and if it's intentional, it's not a very good feature to have, especially on servers.
I've been running a Java server with 1.14 for about a week, and my world is littered with them. I've already started killing every such llama I see. I hope it gets resolved because there are spots in caves where players don't go often. This puts a bit of unnecessary maintenance work for survival server owners.
Β

The llamas can despawn by making all of the wandering trader's trades disabled (locked).

This still happens in 1.11.4

The llamas are supposed to despawn when the trader leaves. That they don't is a bug. I have six of the damn things that I can't use. I'm probably just going to kill them all. Can't even use them as packbeasts

Yep. I found 15 trading llamas in a water hole yesterday and no sign of a trader. they spawn, fall in, the trader leaves and the llamas bob forever amongst the thousands of drowned stuck in there with them.
wish I'd taken a screenshot. They're dead now.

Hi. Does it affect any other versions of the game ( besides 1.11.09?)

Easy, renewable source of leather and leads.

I have had the same thing happen on the Xbox one, ever since 1.12.0. Its broken my passive mob farm by only having trader llama's taking up the cap

The problem might be the fact that killing wandering traders causes the trader llamas to be automatically tamed. On Java, killing the wandering trader will leave it's trader llamas untamed but can be tameable and won't despawn after taming.
Thank you for your report!
However, this issue has been temporarily closed as Awaiting Response
Is this still an issue in the latest beta version (1.16)?
This ticket will automatically reopen when you reply.
Quick Links:
π Issue Guidelines β π¬ Mojang Support β π§ Suggestions β π Minecraft Wiki

Sorry about the slow response... I've done a long playthrough in the most recent beta versions to see what the differences are, avoiding the obvious things like interacting with either the wandering trader or the llamas.
The llamas do still linger for a while after the trader disappears, but the problem is no where near as bad as when I first reported the issue. I think what happens is that if the trader disappears and the llamas don't, after a couple game days the llamas will now despawn. They do linger long enough that I still run across them from time to time, usually underground, confirming the problem still exists.
I have a guess about how this occurs, though. I don't think it happens when the trader despawns naturally, but when he is killed by a hostile mob, suffocation in a block, or something else other than being killed by a player or pet. Since the trader didn't despawn. the llamas don't despawn with him, and they are treated like any other passive mob, eventually despawning.

Latest pic of llamas not despawning. These llamas spawned with a trader undergound.
[media]
Example of a trader and llamas spawning in a dangerous area.
[media]
affects 1.16.20

Iβve been working on a drowned + squid farm with a glass ceiling, and after 50 minutes afk I found 3 separate pairs of trader llamas on the glass, and only 1 trader.
With further testing of my farm I am finding 4-6 trader llamas after every hour, sometimes blocking baby drowned from pathing into turtle-egg-based traps and thereby hurting farm rates.
[media]
Checking with an NBT viewer reveals that trader llamas spawn with persistence. The fact that they spawn everywhere (on buttons, on glass, in water streams) and cannot despawn is very frustrating.
Update: I just found MCPE-66638 where traders llamas despawning according to the 1.16 despawn rules was reported as a bug. Evidently it was fixed by having them spawn with persistence. Obviously that fix exacerbates the problem reported on this ticket. It is a shame, because traders sometimes being found without llamas has no negative impact on gameplay that I can imagine (unless they are intended to be killed for leather and leads?), but trader llamas persisting without a trader takes up the mob cap and breaks builds like the one in my picture.

The problem here is that the entities\llama.json file in the vanilla behavior pack includes the component
"minecraft:persistent": {
}
within the group
"minecraft:llama_wandering_trader"
.
This makes trader llamas stay persistent forever.
I have fixed the bug in the attached behavior pack by putting "minecraft:persistent" into a new, separate group, "llama_persistent", which gets added at the same point as minecraft:llama_wandering_trader, but gets removed by a new event, "lost", if the llama is unleashed from the trader.

Although I don't need to, I can confirm this is a serious issue in my world. I have trader llamas spawn underground alot, then the trader dies, (either from lava or a mob), leaving the llama indefinitely; This causes the same issue as the drowned, except moreso because you can't fix it in vanilla.
Additionally, I'd like to note that the trader doesn't have to die for the trader llamas to continue to persist. If the trader gets detatched from the llama, the same issue happens.
Please Mojang, fix this issue in 1.17 or a patch for 1.16. It's an easy fix.

Yah Ive had this issue in my survival world. Please mojang fix this. It causes major lag with all those entities. Especially when i don't know where most of them are. Ive found groups of up to 12 llamas stuck in a mineshaft under my house.

After 1.17 the trader llamas now block glow squid and axolotl spawns.
Update: in 1.18 axolotl are classed as water_animal instead of animal, so trader llamas no longer block them from spawning.

Affects 1.17.40.20

Affects 1.17.41

affects 1.18

Affects 1.18.12

The behavior pack attached to this doesn't work in it's current state.
I fixed it by adding an identifier in front of "lost". For example, we use vk as the identifier in our mob behavior packs on the server I run so it now looks like this: "vk:lost" and works great!
A huge thank you to the creator of the original pack bc I had tried several times to create a workaround of my own and wasn't able. My beef with the wandering traders is now over <3

So sorry the pack was broken. I've uploaded an updated version that incorporates more recent changes to the vanilla file and also removes random wandering from trader llamas so they don't push the trader (MCPE-45756).