When does a neutral mob become non hostile towards a player?

I just attacked a llama accidentally instead of taming it. I just went far away from it, out of its sight, and then returned. Now it isn't hostile towards me.

So I wanted to know exactly how and after how much time does a neutral mob become non-hostile after it has become hostile.

I didn't get answer in the wiki.

Edit: Citing sources would be great so that I can rely on it...

Thanks!


Solution 1:

I looked into the game's source code and it turns out Llamas use the generic.follow_range attribute just like the aggressive mobs. The default value is 16 and when the player goes out of this range it will no longer follow the revenge goal.

Other reasons Llama can stop following you:

  1. You die
  2. You are in the same team as the llama
  3. The llama can't see you for 3 seconds (60 ticks)
  4. You become invulnerable (creative/spectator mode, the invunerable player ability)