The bug
When an enderman is aggressive and starts teleporting randomly at day it becomes passive and still teleports randomly during night.
How to reproduce
Set the time to night
Build a two block high tower and stand on it
Spawn an enderman next to you
Switch to survival mode and look at the enderman
Set the time to day
Wait until the enderman stops being aggressive
→ ❌ When you look at the enderman it will not become aggressive anymore
Code analysis
Based on 1.12 decompiled using MCP 9.40 PRE 1
It looks like the problem is that the field net.minecraft.entity.ai.EntityAINearestAttackableTarget.targetEntity
is not reset when net.minecraft.entity.EntityLiving.attackTarget
is null
. This is the case if it is day and an enderman tried to attack a player for 30 seconds. However, changing this might have unexpected side effects.
Linked issues
is duplicated by 4
relates to 2
Comments 19
Confirmed in 19w34a
Also it seems like after becoming passive it has the same behavior as it had in MC-96946, but in Survival mode
Dupe of either MC-7980 or MC-19138