public class PlayerChangeGamemodeEvent extends PlayerEvent implements Cancellable
| Constructor and Description |
|---|
PlayerChangeGamemodeEvent(Player player,
Gamemode gamemode) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getCancelReason()
If the event was cancelled, this function returns the (optional) reason.
|
Gamemode |
getNewGamemode()
Gets the new game mode.
|
boolean |
isCancelled()
Determines if the event is cancelled.
|
void |
setCancelled(boolean cancel)
Cancels this event.
|
void |
setCancelled(boolean cancel,
java.lang.String reason)
Cancels this event and provides a reason (which will be displayed for the player)
why the event was cancelled (or more precisely, why he is not allowed to change the
game mode).
|
void |
setNewGamemode(Gamemode mode)
Changes the new game mode for the player.
|
getPlayerpublic Gamemode getNewGamemode()
public void setNewGamemode(Gamemode mode)
mode - the new game mode.public boolean isCancelled()
CancellableisCancelled in interface Cancellablepublic void setCancelled(boolean cancel)
CancellablesetCancelled in interface Cancellablecancel - set to true if you want to cancel this event.public void setCancelled(boolean cancel,
java.lang.String reason)
cancel - set to true if you want to cancel this event.reason - a reason why the event was cancelled. The player can see this
reason in his console. Provide null if you don't want to show a reason. Has no
effect if this event will not be cancelled, or if it is threaded.setCancelled(boolean)public java.lang.String getCancelReason()