Package net.minestom.server.event.player
Class PlayerCommandEvent
java.lang.Object
net.minestom.server.event.Event
net.minestom.server.event.CancellableEvent
net.minestom.server.event.player.PlayerCommandEvent
public class PlayerCommandEvent extends CancellableEvent
Called every time a player send a message starting by '/'.
-
Constructor Summary
Constructors Constructor Description PlayerCommandEvent(Player player, java.lang.String command)
-
Method Summary
Modifier and Type Method Description java.lang.String
getCommand()
Gets the command used (command name + arguments).Player
getPlayer()
Gets the player who sent the command.void
setCommand(java.lang.String command)
Changes the command to execute.
-
Constructor Details
-
Method Details
-
getPlayer
Gets the player who sent the command.- Returns:
- the player
-
getCommand
@NotNull public java.lang.String getCommand()Gets the command used (command name + arguments).- Returns:
- the command that the player wants to execute
-
setCommand
public void setCommand(@NotNull java.lang.String command)Changes the command to execute.- Parameters:
command
- the new command
-