Skip to content

World

Represents the in-game world, exposing time, dimension, spawn location, and chunk state information.

Fields

day: boolean Read-Only

Indicates whether it is currently daytime in the world.

dimension: string Read-Only

The identifier of the world’s dimension (e.g., "minecraft:overworld", "minecraft:the_nether").

night: boolean Read-Only

Indicates whether it is currently nighttime in the world.

realtime: number Read-Only

The real-world time elapsed since the world was created, in milliseconds.

spawnPos: Vec3 Read/Write

The world spawn point where players appear when respawning.

time: number Read-Only

The current in-game time, measured in ticks.

Methods

isLoaded(pos: Vec3) loaded: boolean

Checks whether the chunk containing the specified position is currently loaded in memory.

Example

local position = Vec3:new(100, 64, 100)
if world:isLoaded(position) then
    print("The chunk at the specified position is loaded.")
else
    print("The chunk at the specified position is not loaded.")
end

Parameters

  • pos: Vec3 The position to check.

Returns

  • loaded: boolean true if the chunk is loaded, false otherwise.