Skip to content

Class endstone::ActorDamageEvent

ClassList > endstone > ActorDamageEvent

Called when an Actor is damaged.

  • #include <endstone/event/actor/actor_damage_event.h>

Inherits the following classes: endstone::Cancellable

Public Functions

Type Name
ActorDamageEvent (Mob & actor, std::unique_ptr< DamageSource > damage_source, const float damage)
ENDSTONE_EVENT (ActorDamageEvent)
float getDamage () const
Gets the raw amount of damage caused by the event.
DamageSource & getDamageSource () const
Get the source of damage.
void setDamage (const float damage)
Sets the raw amount of damage caused by the event.

Public Functions inherited from endstone::Cancellable

See endstone::Cancellable

Type Name
virtual void cancel ()
Cancel this event. A cancelled event will not be executed in the server, but will still pass to other plugins.
virtual bool isCancelled () override const
Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.
virtual void setCancelled (bool cancel) override
Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.

Public Functions inherited from endstone::ICancellable

See endstone::ICancellable

Type Name
virtual void cancel () = 0
virtual bool isCancelled () const = 0
virtual void setCancelled (bool cancel) = 0
virtual ~ICancellable () = default

Public Functions Documentation

function ActorDamageEvent

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

function ENDSTONE_EVENT

endstone::ActorDamageEvent::ENDSTONE_EVENT (
    ActorDamageEvent
) 

function getDamage

Gets the raw amount of damage caused by the event.

inline float endstone::ActorDamageEvent::getDamage () const

Returns:

The raw amount of damage caused by the event


function getDamageSource

Get the source of damage.

inline DamageSource & endstone::ActorDamageEvent::getDamageSource () const

Returns:

a DamageSource detailing the source of the damage.


function setDamage

Sets the raw amount of damage caused by the event.

inline void endstone::ActorDamageEvent::setDamage (
    const  float damage
) 

Parameters:

  • damage The raw amount of damage caused by the event


The documentation for this class was generated from the following file include/endstone/event/actor/actor_damage_event.h