Class TeamSendMessageEvent
java.lang.Object
org.bukkit.event.Event
com.booksaw.betterTeams.customEvents.TeamEvent
com.booksaw.betterTeams.customEvents.TeamPlayerEvent
com.booksaw.betterTeams.customEvents.TeamSendMessageEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
An event which is called before a message is sent from a
TeamPlayer to members of their Team.-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Field Summary
Fields inherited from class com.booksaw.betterTeams.customEvents.TeamPlayerEvent
teamPlayer -
Constructor Summary
ConstructorsConstructorDescriptionTeamSendMessageEvent(@NotNull Team team, @NotNull TeamPlayer sender, @NotNull String rawMessage, @NotNull String proposedFormat, @NotNull String senderNamePrefix, @NotNull Collection<TeamPlayer> recipients) Creates an event with the original data for the message. -
Method Summary
Modifier and TypeMethodDescriptionThe format which will be used to format the message.UsinggetFormat()andgetRawMessage(), this method will format the raw message and return the formatted message using the current format.static org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListA mutable set of players which are going to receive a copy of the message.voidThe format which will be used to format the message.voidsetRawMessage(String rawMessage) voidsetSenderNamePrefix(String senderNamePrefix) Methods inherited from class com.booksaw.betterTeams.customEvents.TeamPlayerEvent
getPlayer, getTeamPlayerMethods inherited from class com.booksaw.betterTeams.customEvents.TeamEvent
getTeam, isCancelled, setCancelledMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
TeamSendMessageEvent
public TeamSendMessageEvent(@NotNull @NotNull Team team, @NotNull @NotNull TeamPlayer sender, @NotNull @NotNull String rawMessage, @NotNull @NotNull String proposedFormat, @NotNull @NotNull String senderNamePrefix, @NotNull @NotNull Collection<TeamPlayer> recipients) Creates an event with the original data for the message.- Parameters:
team- the team which the message is being sent tosender- the sender of the messagerawMessage- the contents of the message being sent (without formatting)proposedFormat- the proposed format for the messagesenderNamePrefix- the prefix which will be appended to the sender's name in the formatted messagerecipients- the current recipients of the message
-
-
Method Details
-
getFormattedMessage
UsinggetFormat()andgetRawMessage(), this method will format the raw message and return the formatted message using the current format.- Returns:
- The formatted message using the current format and raw message.
-
getFormattedSenderName
- Returns:
- The name of the sender as it will be displayed in the message format ('[prefix][name]').
- API Note:
- The name of the sender is retrieved using
Player.getDisplayName()and can be edited accordingly.
-
getSender
- Returns:
- The player sending this message to their team.
- API Note:
- A more readable overload of
TeamPlayerEvent.getTeamPlayer().
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList() -
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-
getRawMessage
-
getFormat
The format which will be used to format the message.- API Note:
- {0} is replaced with the player name and {1} is the message
-
getSenderNamePrefix
-
getRecipients
A mutable set of players which are going to receive a copy of the message.- API Note:
- To change who will receive the message, edit this
Set.
-
setRawMessage
-
setFormat
The format which will be used to format the message.- API Note:
- {0} is replaced with the player name and {1} is the message
-
setSenderNamePrefix
-