Player.spectator

Gets the player's gamemode.

  1. bool spectator [@property getter]
    class Player
    final pure nothrow @property @safe @nogc
    bool
    spectator
    ()
  2. bool spectator [@property setter]

Examples

if(player.gamemode == Gamemode.creative) {
   ...
}
if(player.adventure) {
   ...
}

Meta