Skip to Content
⚠ Under Construction
ReferenceC++ APIActorDamageEvent

endstone::ActorDamageEvent

Called when an Actor is damaged.

Bases: endstone::Cancellable< ActorEvent< Mob > >

Attributes:

NameDescription
NAME

Functions:

NameDescription
ActorDamageEvent
getDamageGets the raw amount of damage caused by the event.
getDamageSourceGet the source of damage.
getEventName
setDamageSets the raw amount of damage caused by the event.

NAME

const std::string endstone::ActorDamageEvent::NAME;

ActorDamageEvent

ActorDamageEvent(Mob &actor, std::unique_ptr<DamageSource> damage_source, const float damage)

getDamage

float getDamage() const

Gets the raw amount of damage caused by the event.

Returns:

The raw amount of damage caused by the event

getDamageSource

DamageSource &getDamageSource() const

Get the source of damage.

Returns:

a DamageSource detailing the source of the damage.

getEventName

std::string getEventName() override const

Gets a user-friendly identifier for this event.

Returns:

name of this event

setDamage

void setDamage(const float damage)

Sets the raw amount of damage caused by the event.

Parameters:

  • damage The raw amount of damage caused by the event
Last updated on