changeGamemode

abstract fun changeGamemode(    player: Player,     newGameMode: GameMode,     silent: Boolean,     executor: CommandSender? = null,     sendMessage: Boolean = true)

Change a players gamemode to a new gamemode.

Parameters

player

The Player whose gamemode we are changing.

newGameMode

the new GameMode that the player will be.

silent

if a target player exists, they will recieve a message if this is true

executor

the person who ran the command or null if the player did it to themselves

sendMessage

if true sends messages to players involved, if false it doesn't