-
Bug
-
Resolution: Unresolved
-
None
-
1.20.4, 1.20.5 Release Candidate 1
-
None
-
Plausible
-
Entities, Performance
-
Normal
-
Platform
Players leak the last entity they took damage from and can keep long chain of unloaded entities and worlds in the memory until they are damaged again. For example player A takes damage from enderman in the end and then they damage player B in the overworld. Finally they end up changing their dimension to the nether and disconnect. Now player B keeps the reference to player A alive, which also roots the long gone enderman.
This seems to be due to the fieldĀ lastDamageSource in LivingEntity which is never cleared unless theĀ getLastDamageSource method is called and 40 ticks has passed since the damage was taken. The fix would be to move this to be part of the tick procedure.