Go: World¶
Functions¶
ScanRegion¶
| Go | |
|---|---|
ScanRegion reads every block and entity in a box. Server thread only.
- Parameters:
- dim :
int32 - x1 :
int32 - y1 :
int32 - z1 :
int32 - x2 :
int32 - y2 :
int32 - z2 :
int32
- dim :
- Return type:
([]BlockInfo, []EntityInfo, error) - Slots:
scan_region
ScanRegionIndexed¶
| Go | |
|---|---|
ScanRegionIndexed reads a box as a palette of distinct block states and the cells that index it, which is far smaller than ScanRegion for a large box. Server thread only.
- Parameters:
- dim :
int32 - x1 :
int32 - y1 :
int32 - z1 :
int32 - x2 :
int32 - y2 :
int32 - z2 :
int32
- dim :
- Return type:
([]PaletteEntry, []BlockCell, error) - Slots:
scan_region_indexed
GetBlock¶
| Go | |
|---|---|
GetBlock reads the block at a cell. Server thread only.
- Parameters:
- dim :
int32 - x :
int32 - y :
int32 - z :
int32
- dim :
- Return type:
(BlockInfo, error) - Slots:
get_block
Seed¶
| Go | |
|---|---|
Seed is the level seed.
- Return type:
(int64, error) - Slots:
get_seed
Difficulty¶
| Go | |
|---|---|
Difficulty is the level difficulty, 0 peaceful to 3 hard.
- Return type:
(int32, error) - Slots:
get_difficulty
SetDifficulty¶
| Go | |
|---|---|
SetDifficulty sets the level difficulty.
- Parameters:
- d :
int32
- d :
- Return type:
error - Slots:
set_difficulty
GameRule¶
| Go | |
|---|---|
GameRule reads a game rule as text.
- Parameters:
- name :
string
- name :
- Return type:
(string, error) - Slots:
game_rule_get
SetGameRule¶
| Go | |
|---|---|
SetGameRule writes a game rule from text.
- Parameters:
- name :
string - value :
string
- name :
- Return type:
error - Slots:
game_rule_set
Time¶
| Go | |
|---|---|
Time is the time of day in ticks.
- Return type:
(int64, error) - Slots:
get_time
SetTime¶
| Go | |
|---|---|
SetTime sets the time of day in ticks.
- Parameters:
- t :
int64
- t :
- Return type:
error - Slots:
set_time
SetWeather¶
| Go | |
|---|---|
SetWeather sets the weather: 0 clear, 1 rain, 2 thunder.
- Parameters:
- weather :
int32
- weather :
- Return type:
error - Slots:
set_weather
SaveLevel¶
| Go | |
|---|---|
SaveLevel saves the level now.
- Return type:
error - Slots:
level_save
SpawnParticle¶
| Go | |
|---|---|
SpawnParticle shows a particle effect to everyone near it.
- Parameters:
- dim :
int32 - effect :
string - x :
float64 - y :
float64 - z :
float64
- dim :
- Return type:
error - Slots:
spawn_particle
Explode¶
| Go | |
|---|---|
Explode makes an explosion of the given radius.
- Parameters:
- dim :
int32 - x :
float64 - y :
float64 - z :
float64 - radius :
float32 - o :
ExplodeOptions
- dim :
- Return type:
error - Slots:
explode
DefaultSpawn¶
| Go | |
|---|---|
DefaultSpawn is the level's world spawn.
- Return type:
(x, y, z int32, err error) - Slots:
level_get_default_spawn
SetDefaultSpawn¶
| Go | |
|---|---|
SetDefaultSpawn moves the level's world spawn.
- Parameters:
- x :
int32 - y :
int32 - z :
int32
- x :
- Return type:
error - Slots:
level_set_default_spawn
SetBiome¶
| Go | |
|---|---|
SetBiome sets the biome of every column in a rectangle and returns how many changed.
- Parameters:
- dim :
int32 - minX :
int32 - minZ :
int32 - maxX :
int32 - maxZ :
int32 - biome :
string
- dim :
- Return type:
(int32, error) - Slots:
level_set_biome
FindPath¶
| Go | |
|---|---|
FindPath computes a path for an actor to a target cell, as the host's SNBT. Every current host answers not provided.
- Parameters:
- who :
Entity - x :
int32 - y :
int32 - z :
int32
- who :
- Return type:
(*Nbt, error) - Slots:
level_find_path
UpdateWeather¶
| Go | |
|---|---|
UpdateWeather sets the level and the remaining ticks of rain and of lightning.
- Parameters:
- rainLevel :
float32 - rainTicks :
int32 - lightningLevel :
float32 - lightningTicks :
int32
- rainLevel :
- Return type:
error - Slots:
level_update_weather
LevelSleepStatus¶
| Go | |
|---|---|
LevelSleepStatus reads the sleep status of the players.
- Return type:
(SleepStatus, error) - Slots:
level_get_sleep_status
Villages¶
| Go | |
|---|---|
Villages lists the villages of one dimension.
- Parameters:
- dim :
int32
- dim :
- Return type:
([]Village, error) - Slots:
villages
StructuresNear¶
| Go | |
|---|---|
StructuresNear lists the hardcoded generation areas of the loaded chunks within a radius.
- Parameters:
- dim :
int32 - x :
int32 - y :
int32 - z :
int32 - radius :
int32
- dim :
- Return type:
([]Structure, error) - Slots:
structures_near
ChunksLoaded¶
| Go | |
|---|---|
ChunksLoaded reports whether every chunk covered by the region is in memory.
- Parameters:
- dim :
int32 - minX :
int32 - minZ :
int32 - maxX :
int32 - maxZ :
int32
- dim :
- Return type:
(bool, error) - Slots:
level_chunks_loaded
DeleteChunkKeys¶
| Go | |
|---|---|
DeleteChunkKeys deletes every save key of a chunk, so the engine regenerates it from the generator on its next load, and returns how many keys went. Only an unloaded chunk can be restored this way.
- Parameters:
- dim :
int32 - chunkX :
int32 - chunkZ :
int32
- dim :
- Return type:
(int32, error) - Slots:
level_delete_chunk_keys
ChunkKeys¶
| Go | |
|---|---|
ChunkKeys lists every save key of a chunk. A key is binary, and a Go string holds it as it is.
- Parameters:
- dim :
int32 - chunkX :
int32 - chunkZ :
int32
- dim :
- Return type:
([]string, error) - Slots:
level_chunk_keys
DeleteSaveKey¶
| Go | |
|---|---|
DeleteSaveKey deletes one save key byte for byte. The content is not interpreted.
- Parameters:
- key :
string
- key :
- Return type:
error - Slots:
level_delete_key
WorldWeather¶
| Go | |
|---|---|
WorldWeather reads one PIER_WPROP_* value of dimension dim. The error covers an unknown key, a dimension that does not exist and a level that is not ready.
- Parameters:
- dim :
int32 - prop :
int32
- dim :
- Return type:
(float64, error)
WorldRainLevel¶
| Go | |
|---|---|
WorldRainLevel is the rain level of a dimension, 0 for none to 1 for full rain.
- Parameters:
- dim :
int32
- dim :
- Return type:
(float64, error)
WorldTargetRainLevel¶
| Go | |
|---|---|
WorldTargetRainLevel reads PIER_WPROP_TARGET_RAIN_LEVEL of dimension dim.
- Parameters:
- dim :
int32
- dim :
- Return type:
(float64, error)
WorldLightningLevel¶
| Go | |
|---|---|
WorldLightningLevel is the lightning level of a dimension, 0 for none to 1 for a storm.
- Parameters:
- dim :
int32
- dim :
- Return type:
(float64, error)
WorldTargetLightningLevel¶
| Go | |
|---|---|
WorldTargetLightningLevel reads PIER_WPROP_TARGET_LIGHTNING_LEVEL of dimension dim.
- Parameters:
- dim :
int32
- dim :
- Return type:
(float64, error)
WorldFogLevel¶
| Go | |
|---|---|
WorldFogLevel reads PIER_WPROP_FOG_LEVEL of dimension dim.
- Parameters:
- dim :
int32
- dim :
- Return type:
(float64, error)
WorldSkyFlashTime¶
| Go | |
|---|---|
WorldSkyFlashTime reads PIER_WPROP_SKY_FLASH_TIME of dimension dim.
- Parameters:
- dim :
int32
- dim :
- Return type:
(float64, error)
EntityInfo¶
EntityInfo is one entity a region scan found: the cell holding it, its type and its SNBT.
PaletteEntry¶
PaletteEntry is one distinct block state of an indexed scan.
BlockCell¶
BlockCell is one cell and an index into a palette, for ScanRegionIndexed and SetBlocks.
ExplodeOptions¶
| Go | |
|---|---|
ExplodeOptions are the optional parts of an explosion.
SleepStatus¶
SleepStatus is how many players sleep.
Village¶
Village is one village.
Structure¶
Structure is one hardcoded generation area: a stronghold, a witch hut, an ocean monument or a similar structure.