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

The dedicated server / integrated server class. More...

#include <SDK.h>

Public Member Functions

ServerLevelgetLevel (int dimension)
 Get the ServerLevel for a dimension.
PlayerListgetPlayers ()
 Get the PlayerList containing all connected ServerPlayers.
class CommandDispatcher * getCommandDispatcher ()
 Get the server's CommandDispatcher.
bool isPvpAllowed ()
 Check if PvP is currently allowed.
void setPvpAllowed (bool pvp)
 Enable or disable PvP.
bool isFlightAllowed ()
 Check if flight is allowed.
void setFlightAllowed (bool allowFlight)
 Enable or disable flight.
bool isNetherEnabled ()
 Check if the Nether is enabled.
bool isHardcore ()
 Check if hardcore mode is active.
bool isCommandBlockEnabled ()
 Check if command blocks are enabled.
int getMaxBuildHeight ()
 Get the max build height (default 256).
void setMaxBuildHeight (int height)
 Set the max build height.
int getPlayerIdleTimeout ()
 Get player idle timeout in minutes.
void setPlayerIdleTimeout (int minutes)
 Set player idle timeout.
void broadcastStartSavingPacket ()
 Broadcast start-saving packet to all clients.
void broadcastStopSavingPacket ()
 Broadcast stop-saving packet to all clients.
void info (const wstring &string)
 Log an info message to the server console.
void warn (const wstring &string)
 Log a warning to the server console.
void handleConsoleInput (const wstring &msg, class ConsoleInputSource *source)
 Handle a console command string.

Static Public Member Functions

static MinecraftServergetInstance ()
 Returns the global MinecraftServer instance.
static void SetTimeOfDay (__int64 time)
 Set the world time at the end of the current tick.
static void SetTime (__int64 time)
 Set the absolute world time at the end of the current tick.
static bool serverHalted ()
 Whether the server has been halted.
static void HaltServer (bool bPrimaryPlayerSignedOut=false)
 Halt the server.

Public Attributes

int tickCount
 Current tick count.
bool animals
 True if animals spawn.
bool npcs
 True if NPCs (villagers etc.) spawn.
bool pvp
 True if PvP is allowed.
bool allowFlight
 True if flight is allowed.
wstring motd
 Server MOTD string.

Detailed Description

The dedicated server / integrated server class.

Obtain via SDK::GetServer() or MinecraftServer::getInstance().

Definition at line 29 of file MinecraftServer.h.

Member Function Documentation

◆ getLevel()

ServerLevel * MinecraftServer::getLevel ( int dimension)

Get the ServerLevel for a dimension.

Parameters
dimension0 = Overworld, -1 = Nether, 1 = End.
Returns
ServerLevel pointer or nullptr.

◆ SetTime()

void MinecraftServer::SetTime ( __int64 time)
static

Set the absolute world time at the end of the current tick.

Parameters
timeAbsolute tick count.

◆ SetTimeOfDay()

void MinecraftServer::SetTimeOfDay ( __int64 time)
static

Set the world time at the end of the current tick.

Parameters
timeTicks (0=dawn, 6000=noon, 12000=dusk, 18000=midnight).

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