getAttacker

public LivingEntity getAttacker()

Gets the attacker entity from this event. Handles both direct melee and projectile attacks.

Return

The living entity that caused the damage, or null if not applicable