Skip to content

Class endstone::PlayerDeathEvent

ClassList > endstone > PlayerDeathEvent

Called when a Player dies.

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

Inherits the following classes: endstone::ActorDeathEvent, endstone::PlayerEvent

Public Static Attributes

Type Name
const std::string NAME = = "PlayerDeathEvent"

Public Static Attributes inherited from endstone::ActorDeathEvent

See endstone::ActorDeathEvent

Type Name
const std::string NAME = = "ActorDeathEvent"

Public Functions

Type Name
PlayerDeathEvent (Player & player, std::string death_message)
const std::string & getDeathMessage () const
Get the death message that will appear to everyone on the server.
virtual std::string getEventName () override const
virtual bool isCancellable () override const
void setDeathMessage (const std::string & death_message)
Set the death message that will appear to everyone on the server.
~PlayerDeathEvent () override

Public Functions inherited from endstone::ActorDeathEvent

See endstone::ActorDeathEvent

Type Name
ActorDeathEvent (Actor & actor)
virtual std::string getEventName () override const
virtual bool isCancellable () override const
~ActorDeathEvent () override

Public Functions inherited from endstone::ActorEvent

See endstone::ActorEvent

Type Name
ActorEvent (Actor & actor)
Actor & getActor () const
Returns the Actor involved in this event.
~ActorEvent () override

Public Functions inherited from endstone::Event

See endstone::Event

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 inherited from endstone::PlayerEvent

See endstone::PlayerEvent

Type Name
PlayerEvent (Player & player)
Player & getPlayer () const
~PlayerEvent () override

Public Functions inherited from endstone::Event

See endstone::Event

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 Static Attributes Documentation

variable NAME

const std::string endstone::PlayerDeathEvent::NAME;

Public Functions Documentation

function PlayerDeathEvent

inline explicit endstone::PlayerDeathEvent::PlayerDeathEvent (
    Player & player,
    std::string death_message
) 

function getDeathMessage

Get the death message that will appear to everyone on the server.

inline const std::string & endstone::PlayerDeathEvent::getDeathMessage () const

Returns:

Message to appear to other players on the server.


function getEventName

inline virtual std::string endstone::PlayerDeathEvent::getEventName () override const

Gets a user-friendly identifier for this event.

Returns:

name of this event

Implements endstone::ActorDeathEvent::getEventName


function isCancellable

inline virtual bool endstone::PlayerDeathEvent::isCancellable () override const

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

Returns:

true if this event can be cancelled

Implements endstone::ActorDeathEvent::isCancellable


function setDeathMessage

Set the death message that will appear to everyone on the server.

inline void endstone::PlayerDeathEvent::setDeathMessage (
    const std::string & death_message
) 

Parameters:

  • death_message Message to appear to other players on the server.

function ~PlayerDeathEvent

endstone::PlayerDeathEvent::~PlayerDeathEvent () override


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