Skip to content

Class endstone::BroadcastMessageEvent

ClassList > endstone > BroadcastMessageEvent

Event triggered for server broadcast messages such as fromServer::broadcast .More...

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

Inherits the following classes: endstone::ServerEvent

Public Static Attributes

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

Public Functions

Type Name
BroadcastMessageEvent (bool async, std::string message, std::unordered_set< const CommandSender * > recipients)
virtual std::string getEventName () override const
const std::string & getMessage () const
const std::unordered_set< const CommandSender * > & getRecipients () const
virtual bool isCancellable () override const
void setMessage (std::string message)

Public Functions inherited from endstone::ServerEvent

See endstone::ServerEvent

Type Name
Event (bool async=false)
Event (const Event &) = delete

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

Detailed Description

This event should be async if fired from an async thread.

Public Static Attributes Documentation

variable NAME

const std::string endstone::BroadcastMessageEvent::NAME;

Public Functions Documentation

function BroadcastMessageEvent

inline endstone::BroadcastMessageEvent::BroadcastMessageEvent (
    bool async,
    std::string message,
    std::unordered_set< const CommandSender * > recipients
) 

function getEventName

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

Gets a user-friendly identifier for this event.

Returns:

name of this event

Implements endstone::Event::getEventName


function getMessage

inline const std::string & endstone::BroadcastMessageEvent::getMessage () const

Get the message to broadcast.

Returns:

Message to broadcast


function getRecipients

inline const std::unordered_set< const CommandSender * > & endstone::BroadcastMessageEvent::getRecipients () const

Gets a set of recipients that this broadcast message will be displayed to.

Returns:

All CommandSenders who will see this broadcast message


function isCancellable

inline virtual bool endstone::BroadcastMessageEvent::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::Event::isCancellable


function setMessage

inline void endstone::BroadcastMessageEvent::setMessage (
    std::string message
) 

Set the message to broadcast.

Parameters:

  • message New message to broadcast


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