Package net.md_5.bungee.api.event
Class ChatEvent
- java.lang.Object
-
- net.md_5.bungee.api.plugin.Event
-
- net.md_5.bungee.api.event.TargetedEvent
-
- net.md_5.bungee.api.event.ChatEvent
-
- All Implemented Interfaces:
Cancellable
public class ChatEvent extends TargetedEvent implements Cancellable
Event called when a player sends a message to a server.
-
-
Constructor Summary
Constructors Constructor Description ChatEvent(Connection sender, Connection receiver, String message)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(Object other)booleanequals(Object o)StringgetMessage()Text contained in this chat.inthashCode()booleanisCancelled()Cancelled state.booleanisCommand()Checks whether this message is valid as a commandbooleanisProxyCommand()Checks whether this message is run on this proxy server.voidsetCancelled(boolean cancelled)Cancelled state.voidsetMessage(String message)Text contained in this chat.StringtoString()-
Methods inherited from class net.md_5.bungee.api.event.TargetedEvent
getReceiver, getSender
-
-
-
-
Constructor Detail
-
ChatEvent
public ChatEvent(Connection sender, Connection receiver, String message)
-
-
Method Detail
-
isCommand
public boolean isCommand()
Checks whether this message is valid as a command- Returns:
- if this message is a command
-
isProxyCommand
public boolean isProxyCommand()
Checks whether this message is run on this proxy server.- Returns:
- if this command runs on the proxy
- See Also:
PluginManager.isExecutableCommand(java.lang.String, net.md_5.bungee.api.CommandSender)
-
isCancelled
public boolean isCancelled()
Cancelled state.- Specified by:
isCancelledin interfaceCancellable- Returns:
- the cancelled state of this event
-
getMessage
public String getMessage()
Text contained in this chat.
-
setCancelled
public void setCancelled(boolean cancelled)
Cancelled state.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancelled- the state to set
-
setMessage
public void setMessage(String message)
Text contained in this chat.
-
toString
public String toString()
- Overrides:
toStringin classTargetedEvent
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classTargetedEvent
-
canEqual
protected boolean canEqual(Object other)
- Overrides:
canEqualin classTargetedEvent
-
hashCode
public int hashCode()
- Overrides:
hashCodein classTargetedEvent
-
-