Faucet Mod SDK 1.0.0
Modding API for Minecraft Legacy Console Edition
Loading...
Searching...
No Matches
ServerPlayerGameMode Class Reference

Manages a ServerPlayer's game mode state and block breaking. More...

#include <SDK.h>

Public Member Functions

bool isSurvival ()
 Check if the player is in Survival mode.
bool isCreative ()
 Check if the player is in Creative mode.
void setGameModeForPlayer (GameType *gameType)
 Change the player's game mode.
GameType * getGameModeForPlayer ()
 Get the current GameType for this player.
bool destroyBlock (int x, int y, int z)
 Force-destroy a block at a position (ignores survival rules).
class GameRulesInstance * getGameRules ()
 Get the game rules instance.

Public Attributes

Level * level
 The level this game mode is operating in.
shared_ptr< ServerPlayerplayer
 The player this game mode belongs to.

Detailed Description

Manages a ServerPlayer's game mode state and block breaking.

Access via ServerPlayer::gameMode.

Definition at line 1095 of file SDK.h.

Member Function Documentation

◆ destroyBlock()

bool ServerPlayerGameMode::destroyBlock ( int x,
int y,
int z )

Force-destroy a block at a position (ignores survival rules).

Parameters
x,y,zBlock coordinates.
Returns
true if the block was destroyed.

◆ getGameModeForPlayer()

GameType * ServerPlayerGameMode::getGameModeForPlayer ( )

Get the current GameType for this player.

Returns
Pointer to the current GameType.

◆ isCreative()

bool ServerPlayerGameMode::isCreative ( )

Check if the player is in Creative mode.

Returns
true if Creative.

◆ isSurvival()

bool ServerPlayerGameMode::isSurvival ( )

Check if the player is in Survival mode.

Returns
true if Survival.

◆ setGameModeForPlayer()

void ServerPlayerGameMode::setGameModeForPlayer ( GameType * gameType)

Change the player's game mode.

Parameters
gameTypeNew GameType.

The documentation for this class was generated from the following file: