World
Auto-generated from
src/stdlib/world.mcrs— do not edit manually.
API
- set_day
- set_night
- set_noon
- set_midnight
- weather_clear
- weather_rain
- weather_thunder
- enable_keep_inventory
- disable_keep_inventory
- disable_mob_griefing
- disable_fire_spread
- set_peaceful
- set_easy
- set_normal
- set_hard
- barrier_wall
- clear_area
- glass_box
- sun_altitude
- sun_azimuth
set_day
Sets the world time to daytime. Uses tick 1000, the standard morning daylight value in Minecraft.
fn set_day()set_night
Sets the world time to night. Uses tick 13000, the standard nighttime value in Minecraft.
fn set_night()set_noon
Sets the world time to noon. Uses tick 6000, when the sun is at its highest point.
fn set_noon()set_midnight
Sets the world time to midnight. Uses tick 18000, when the moon is at its highest point.
fn set_midnight()weather_clear
Sets the weather to clear.
fn weather_clear()weather_rain
Sets the weather to rain.
fn weather_rain()weather_thunder
Sets the weather to thunder.
fn weather_thunder()enable_keep_inventory
Enables the keepInventory gamerule.
fn enable_keep_inventory()disable_keep_inventory
Disables the keepInventory gamerule.
fn disable_keep_inventory()disable_mob_griefing
Disables mob griefing by setting mobGriefing to false.
fn disable_mob_griefing()disable_fire_spread
Disables fire spread by setting doFireTick to false.
fn disable_fire_spread()set_peaceful
Sets the difficulty to peaceful.
fn set_peaceful()set_easy
Sets the difficulty to easy.
fn set_easy()set_normal
Sets the difficulty to normal.
fn set_normal()set_hard
Sets the difficulty to hard.
fn set_hard()barrier_wall
Fills a cuboid with barriers.
fn barrier_wall(x1: int, y1: int, z1: int, x2: int, y2: int, z2: int)Parameters
| Parameter | Description |
|---|---|
x1 | First corner X |
y1 | First corner Y |
z1 | First corner Z |
x2 | Opposite corner X |
y2 | Opposite corner Y |
z2 | Opposite corner Z |
clear_area
Replaces a cuboid with air to clear the area.
fn clear_area(x1: int, y1: int, z1: int, x2: int, y2: int, z2: int)Parameters
| Parameter | Description |
|---|---|
x1 | First corner X |
y1 | First corner Y |
z1 | First corner Z |
x2 | Opposite corner X |
y2 | Opposite corner Y |
z2 | Opposite corner Z |
glass_box
Builds a hollow glass box. The outer cuboid is filled with glass and the interior is then carved out.
fn glass_box(x1: int, y1: int, z1: int, x2: int, y2: int, z2: int)Parameters
| Parameter | Description |
|---|---|
x1 | First corner X |
y1 | First corner Y |
z1 | First corner Z |
x2 | Opposite corner X |
y2 | Opposite corner Y |
z2 | Opposite corner Z |
sun_altitude
Computes the sun elevation angle from world time. Result is fixed-point degrees ×10000 where noon is 900000 (+90°) and midnight is -900000 (-90°). Uses sin_fixed, so callers must also include math.mcrs.
fn sun_altitude(ticks: int): intParameters
| Parameter | Description |
|---|---|
ticks | World time in Minecraft ticks |
Returns: Sun altitude in degrees ×10000
Example
let alt = sun_altitude(6000) // 900000sun_azimuth
Computes the sun compass azimuth from world time. Tick 0 maps to east (0) and advances linearly through the day.
fn sun_azimuth(ticks: int): intParameters
| Parameter | Description |
|---|---|
ticks | World time in Minecraft ticks |
Returns: Compass angle in degrees ×10000, wrapped to [0, 3600000)
Example
let az = sun_azimuth(6000) // 900000