Skip to content

Class endstone::Event

ClassList > endstone > Event

Represents an event.

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

Inherited by the following classes: endstone::ActorEvent, endstone::BlockEvent, endstone::PlayerEvent, endstone::ServerEvent, endstone::WeatherEvent

Public Functions

Type Name
Event (bool async=false)
Event (const Event &) = delete
virtual std::string getEventName () const = 0
bool isAsynchronous () const
virtual bool isCancellable () const = 0
bool isCancelled () const
Event & operator= (const Event &) = delete
void setCancelled (bool cancel)
virtual ~Event () = default

Public Functions Documentation

function Event [½]

inline explicit endstone::Event::Event (
    bool async=false
) 

function Event [2/2]

endstone::Event::Event (
    const Event &
) = delete

function getEventName

virtual std::string endstone::Event::getEventName () const = 0

Gets a user-friendly identifier for this event.

Returns:

name of this event


function isAsynchronous

inline bool endstone::Event::isAsynchronous () const

Any custom event that should not by synchronized with other events must use the specific constructor.

Returns:

false by default, true if the event fires asynchronously


function isCancellable

virtual bool endstone::Event::isCancellable () const = 0

Whether the event can be cancelled by a plugin or the server.

Returns:

true if this event can be cancelled


function isCancelled

inline bool endstone::Event::isCancelled () 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

Returns:

true if this event is cancelled


function operator=

Event & endstone::Event::operator= (
    const Event &
) = delete

function setCancelled

inline void endstone::Event::setCancelled (
    bool cancel
) 

Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.

Parameters:

  • cancel true if you wish to cancel this event

function ~Event

virtual endstone::Event::~Event () = default


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