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 boolean
canEqual(Object other)
boolean
equals(Object o)
String
getMessage()
Text contained in this chat.int
hashCode()
boolean
isCancelled()
Cancelled state.boolean
isCommand()
Checks whether this message is valid as a commandboolean
isProxyCommand()
Checks whether this message is run on this proxy server.void
setCancelled(boolean cancelled)
Cancelled state.void
setMessage(String message)
Text contained in this chat.String
toString()
-
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:
isCancelled
in 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:
setCancelled
in interfaceCancellable
- Parameters:
cancelled
- the state to set
-
setMessage
public void setMessage(String message)
Text contained in this chat.
-
toString
public String toString()
- Overrides:
toString
in classTargetedEvent
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classTargetedEvent
-
canEqual
protected boolean canEqual(Object other)
- Overrides:
canEqual
in classTargetedEvent
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classTargetedEvent
-
-