Skip to content

Class endstone::PlayerCommandEvent

ClassList > endstone > PlayerCommandEvent

Called whenever a player runs a command.

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

Inherits the following classes: endstone::Cancellable

Public Functions

Type Name
ENDSTONE_EVENT (PlayerCommandEvent)
PlayerCommandEvent (Player & player, std::string command)
std::string getCommand () const
Gets the command that the player is attempting to send.
void setCommand (std::string command)
Sets the command that the player will send.
~PlayerCommandEvent () override

Public Functions inherited from endstone::Cancellable

See 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

See 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

Public Functions Documentation

function ENDSTONE_EVENT

endstone::PlayerCommandEvent::ENDSTONE_EVENT (
    PlayerCommandEvent
) 

function PlayerCommandEvent

inline explicit endstone::PlayerCommandEvent::PlayerCommandEvent (
    Player & player,
    std::string command
) 

function getCommand

Gets the command that the player is attempting to send.

inline std::string endstone::PlayerCommandEvent::getCommand () const

Returns:

Command the player is attempting to send


function setCommand

Sets the command that the player will send.

inline void endstone::PlayerCommandEvent::setCommand (
    std::string command
) 

Parameters:

  • command New command that the player will send

function ~PlayerCommandEvent

endstone::PlayerCommandEvent::~PlayerCommandEvent () override


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