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.

night: boolean Read-Only

Indicates whether it is currently nighttime in the world.

time: number Read-Only

The current in-game time, measured in ticks.

realtime: number Read-Only

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

dimension: string Read-Only

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

spawnPos: Vec3 Read/Write

The world spawn point where players appear when respawning.

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

Name Type Description
pos Vec3 The position to check.

Returns

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