Перейти к основному содержимому

Protocol: EntityHurtBeforeEvent

Cancelable event fired before damage is applied to an entity.

class EntityHurtBeforeEvent(Protocol)

Related API: DamageCause, Entity

Properties

cancel

cancel: bool

Set to true before the handler returns to cancel the action.

entity

@property
def entity(self) -> Entity:

Entity that would receive the damage.

Related API: Entity

damage

@property
def damage(self) -> float:

Damage amount that would be applied.

cause

@property
def cause(self) -> DamageCause:

Normalized cause understood by the current QuestScript surface.

Related API: DamageCause

damaging_entity

@property
def damaging_entity(self) -> Optional[Entity]:

Attacking entity, or None when there is no entity source.

Related API: Entity