Class endstone::ActorEffectEvent¶
ClassList > endstone > ActorEffectEvent
Called when an effect on a Mob changes.More...
#include <endstone/event/actor/actor_effect_event.h>
Inherits the following classes: endstone::Cancellable
Public Types¶
| Type | Name |
|---|---|
| enum | Action An enum to specify how the effect changed. |
Public Functions¶
| Type | Name |
|---|---|
| ActorEffectEvent (const NotNull< Mob > & mob, Action action, Effect effect) |
|
| ENDSTONE_EVENT (ActorEffectEvent) |
|
| Action | getAction () const Gets how the effect changed. |
| const Effect & | getEffect () const Gets the effect involved in this event. |
| void | setEffect (Effect effect) Sets the effect involved in this event. |
Public Functions inherited from endstone::Cancellable¶
| Type | Name |
|---|---|
| virtual void | cancel () Cancel this event. |
| virtual bool | isCancelled () override const Gets the cancellation state of this event. |
| virtual void | setCancelled (bool cancel) override Sets the cancellation state of this event. |
Public Functions inherited from endstone::ICancellable¶
| Type | Name |
|---|---|
| virtual void | cancel () = 0 Cancels this event. |
| virtual bool | isCancelled () const = 0 Gets the cancellation state of this event. |
| virtual void | setCancelled (bool cancel) = 0 Sets the cancellation state of this event. |
| virtual | ~ICancellable () = default |
Detailed Description¶
This is fired before the change is applied. Cancelling the event prevents it, and the effect may be replaced with a different one via setEffect.
Public Types Documentation¶
enum Action¶
An enum to specify how the effect changed.
Public Functions Documentation¶
function ActorEffectEvent¶
inline explicit endstone::ActorEffectEvent::ActorEffectEvent (
const NotNull < Mob > & mob,
Action action,
Effect effect
)
function ENDSTONE_EVENT¶
function getAction¶
Gets how the effect changed.
Returns:
the action taken on the effect
function getEffect¶
Gets the effect involved in this event.
Returns:
the effect
function setEffect¶
Sets the effect involved in this event.
Parameters:
effectthe effect to apply instead
The documentation for this class was generated from the following file include/endstone/event/actor/actor_effect_event.h