Skip to content

Server

Represents the Minecraft server that is running the game.

Fields

dedicated: boolean — Read-Only

Indicates whether the server is running as a dedicated (standalone) server. false if it is an integrated server running inside a client (e.g. singleplayer or LAN).

difficulty: Difficulty — Read-Only

The difficulty of the game, which all worlds of this server share. Change it with the command /difficulty. See Difficulty.

filesystem: Filesystem — Read-Only

A reference to the server's filesystem.

players: Player[ ] — Read-Only

A list of references to all currently online players.

version: string — Read-Only

The Minecraft version of this server.

worlds: World[ ] — Read-Only

A list of references to all worlds of this server, one per dimension, starting with the overworld.

Methods

getWorld(dimension: DimensionName) → world: World?

Returns a reference to the world for the given dimension name, or nil if the server has no such dimension.

Example

local nether = spell.server:getWorld("the_nether") --[[@as World]]
player:teleport(nether, Vec3(0,64,0))

Parameters

  • dimension: DimensionName — The name of the dimension, e.g. "the_nether" or "overworld".

Returns

  • world: World? — A reference to the world that represents the given dimension, or nil if there is none.