If you are in survival mode, make Enderman hostile, switch to creative mode and then return to survival mode, this Enderman will never attack you again, even if you attack him.
If you are in survival mode, make Enderman hostile, switch to creative mode and then return to survival mode, this Enderman will never attack you again, even if you attack him.
Most likely the same issue as MC-94730; both seem to describe Endermen teleporting around randomly and no longer attacking the player when you anger it in Survival then pacify it (either by switching to Creative or by daylight).