Class endstone::PlayerChatEvent¶
ClassList > endstone > PlayerChatEvent
Called when a player sends a chat message.
#include <endstone/event/player/player_chat_event.h>
Inherits the following classes: endstone::Cancellable
Public Functions¶
Type | Name |
---|---|
ENDSTONE_EVENT (PlayerChatEvent) |
|
PlayerChatEvent (Player & player, std::string message, std::optional< std::vector< Player * > > recipients, std::string format="<{0}> {1}") |
|
std::string | getFormat () const Gets the format to use to display this chat message. |
std::string | getMessage () const Gets the message that the player is attempting to send. |
std::vector< Player * > | getRecipients () const Gets a set of recipients that this chat message will be displayed to. |
void | setFormat (std::string format) Sets the format to use to display this chat message. |
void | setMessage (std::string message) Sets the message that the player will send. |
void | setPlayer (Player & player) Sets the player that this message will display as. |
Public Functions inherited from 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¶
Type | Name |
---|---|
virtual void | cancel () = 0 |
virtual bool | isCancelled () const = 0 |
virtual void | setCancelled (bool cancel) = 0 |
virtual | ~ICancellable () = default |
Public Functions Documentation¶
function ENDSTONE_EVENT¶
function PlayerChatEvent¶
inline explicit endstone::PlayerChatEvent::PlayerChatEvent (
Player & player,
std::string message,
std::optional< std::vector< Player * > > recipients,
std::string format="<{0}> {1}"
)
function getFormat¶
Gets the format to use to display this chat message.
Returns:
format string
function getMessage¶
Gets the message that the player is attempting to send.
Returns:
Message the player is attempting to send
function getRecipients¶
Gets a set of recipients that this chat message will be displayed to.
Returns:
All Players who will see this chat message
function setFormat¶
Sets the format to use to display this chat message.
Parameters:
format
format string
function setMessage¶
Sets the message that the player will send.
Parameters:
message
New message that the player will send
function setPlayer¶
Sets the player that this message will display as.
Parameters:
player
New player which this event will execute as
The documentation for this class was generated from the following file include/endstone/event/player/player_chat_event.h