2024-12-12 16:24:17 +03:00

1.2 KiB

world library

-- Checks if world is open
world.is_open() -> bool

-- Returns worlds information.
world.get_list() -> tables array {
    -- world name
    name: str,
    -- world icon/preview (loading automatically)
    icon: str
    -- engine version the world was saved on
    version: {int, int}
}

-- Returns current day time in range \[0.0-1.0\] 
-- where 0.0 and 1.0 - midnight, 0.5 - noon.
world.get_day_time() -> number

-- Set day time value.
world.set_day_time(time: number)

-- Sets the specified day time cycle speed.
world.set_day_time_speed(value: number)

-- Returns the day time cycle speed.
world.get_day_time_speed() -> number

-- Returns total time passed in the world.
world.get_total_time() -> number

-- Returns world seed.
world.get_seed() -> int

-- Returns generator name.
world.get_generator() -> str

-- Checks the existence of a world by name.
world.exists(name: str) -> bool

-- Checks if the current time is daytime. From 0.333(8am) to 0.833(8pm).
world.is_day() -> bool

-- Checks if the current time is nighttime. From 0.833(8pm) to 0.333(8am).
world.is_night() -> bool

-- Returns the total number of chunks loaded into memory
world.count_chunks() -> int