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
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.