damage

public void damage(double amount)

Inflicts damage on the entity based on the specified amount. This method delegates the damage operation to the damageableComponent associated with the current entity.

Parameters

amount

the amount


public void damage(Entity damager, double amount)

Inflicts damage on this entity by a specified amount, attributed to the given damager. Delegates the damage application and handling to the associated damageable component.

Parameters

damager

the entity causing the damage

amount

the amount of damage to deal


public void damage(Entity damager)

Applies damage to this entity as inflicted by the specified damager. Delegates the damage logic to the damageableComponent associated with this entity.

Parameters

damager

the entity causing the damage


public boolean damage(Projectile projectile)

Applies damage to the current entity based on the attributes of the provided projectile (impact speed, base damage, and bow enchantments such as Power and Piercing).

Return

true if the projectile hit was applied, false if it was ignored (self-hit, non-arrow projectile, or duplicate within the dedup window)