Go: Raw: one typed method per slot¶
Variables¶
Raw¶
| Go | |
|---|---|
Raw is the typed slot layer. Prefer the facades of this package where one exists.
RawAPI¶
RawAPI reaches every slot without a callback, typed in Go and gated: a slot the host lacks is a *NotProvidedError. A result means what abi.h says it means; the rest of the package builds the interpreted API on top of it. Use it through Raw.
Core: entry point, logging and tasks¶
Raw.Log¶
| Go | |
|---|---|
Log calls the log slot.
Log a message through the mod's own LeviLamina logger. level: -1=Off, 0=Fatal, 1=Error, 2=Warn, 3=Info, 4=Debug, 5=Trace (mirrors ll::io::LogLevel). Thread-safe.
- Parameters:
- level :
int32 - msg :
string
- level :
- Return type:
error - Slots:
log
Raw.GamingStatus¶
| Go | |
|---|---|
GamingStatus calls the gaming_status slot.
Current gaming status: 0=Default, 1=Starting, 2=Running, 3=Stopping (mirrors ll::GamingStatus). Thread-safe.
- Return type:
(int32, error) - Slots:
gaming_status
Raw.ScheduleCancel¶
| Go | |
|---|---|
ScheduleCancel calls the schedule_cancel slot.
Drop a task scheduled by this mod if it has not run yet. Returns true if a pending task was actually dropped. Safe to call from any thread and from inside another task. Cancelling leaks user for the same reason as above, so prefer letting short tasks run.
- Parameters:
- taskId :
uint64
- taskId :
- Return type:
(bool, error) - Slots:
schedule_cancel
Raw.SchedulePendingCount¶
| Go | |
|---|---|
SchedulePendingCount calls the schedule_pending_count slot.
Number of tasks this mod still has pending. Intended for a mod to assert it has drained its own work in on_disable / on_unload, which is a precondition for being marked "reload_safe" in its manifest.
- Return type:
(uint32, error) - Slots:
schedule_pending_count
Events¶
Raw.UnsubscribeEvent¶
| Go | |
|---|---|
UnsubscribeEvent calls the unsubscribe_event slot.
Remove a listener previously returned by subscribe_event. Server thread only.
- Parameters:
- listener :
ListenerHandle
- listener :
- Return type:
(bool, error) - Slots:
unsubscribe_event
Raw.ListEvents¶
| Go | |
|---|---|
ListEvents calls the list_events slot.
Enumerate all currently registered event ids. Server thread only.
- Return type:
([]string, error) - Slots:
list_events
Commands¶
Raw.RegisterCommandEnum¶
| Go | |
|---|---|
RegisterCommandEnum calls the register_command_enum slot.
values_snbt = {values:[["name",1L],β¦]} β tryRegisterRuntimeEnum.
- Parameters:
- name :
string - valuesSnbt :
string
- name :
- Return type:
(bool, error) - Slots:
register_command_enum
Raw.RegisterCommandSoftEnum¶
| Go | |
|---|---|
RegisterCommandSoftEnum calls the register_command_soft_enum slot.
values_snbt = {values:["a","b"]} β tryRegisterSoftEnum.
- Parameters:
- name :
string - valuesSnbt :
string
- name :
- Return type:
(bool, error) - Slots:
register_command_soft_enum
Raw.UpdateCommandSoftEnum¶
| Go | |
|---|---|
UpdateCommandSoftEnum calls the update_command_soft_enum slot.
op: 0=set 1=add 2=remove.
- Parameters:
- name :
string - op :
int32 - valuesSnbt :
string
- name :
- Return type:
(bool, error) - Slots:
update_command_soft_enum
Server, ticks and system information¶
Raw.GetCurrentTick¶
| Go | |
|---|---|
GetCurrentTick calls the get_current_tick slot.
Current server tick (the tickID from Level::getCurrentTick()). Returns 0 when the level is not ready. Server thread only.
- Return type:
(uint64, error) - Slots:
get_current_tick
Raw.GetTickDeltaTime¶
| Go | |
|---|---|
GetTickDeltaTime calls the get_tick_delta_time slot.
Wall-clock period of the last frame in seconds (mTickDeltaTime; 0.05 at 20 TPS). It includes the sleep the server inserts to hold 20 Hz, so it is not the time spent computing a tick and its reciprocal is not a tick rate: it is one noisy sample of the frame rate. For TPS and MSPT use get_tps and get_mspt. Returns -1.0 if unavailable. Server thread only.
- Return type:
(float64, error) - Slots:
get_tick_delta_time
Raw.GetPlayerCount¶
| Go | |
|---|---|
GetPlayerCount calls the get_player_count slot.
Number of currently connected players (Level::getActivePlayerCount()). Server thread only.
- Return type:
(int32, error) - Slots:
get_player_count
Raw.GetSimPaused¶
| Go | |
|---|---|
GetSimPaused calls the get_sim_paused slot.
Whether the simulation is currently paused (Level::getSimPaused()). Server thread only.
- Return type:
(bool, error) - Slots:
get_sim_paused
Raw.SysInfoStr¶
| Go | |
|---|---|
SysInfoStr calls the sys_info_str slot.
System info: THREAD-SAFE (plain OS calls).
- Parameters:
- prop :
int32
- prop :
- Return type:
([]string, bool, error) - Slots:
sys_info_str
Raw.SysGetEnv¶
| Go | |
|---|---|
SysGetEnv calls the sys_get_env slot.
- Parameters:
- name :
string
- name :
- Return type:
([]string, bool, error) - Slots:
sys_get_env
Raw.SysSetEnv¶
| Go | |
|---|---|
SysSetEnv calls the sys_set_env slot.
- Parameters:
- name :
string - value :
string
- name :
- Return type:
(bool, error) - Slots:
sys_set_env
Raw.SysIsWine¶
| Go | |
|---|---|
SysIsWine calls the sys_is_wine slot.
- Return type:
(bool, error) - Slots:
sys_is_wine
Raw.ServerInfoStr¶
| Go | |
|---|---|
ServerInfoStr calls the server_info_str slot.
- Parameters:
- prop :
int32
- prop :
- Return type:
([]string, bool, error) - Slots:
server_info_str
Raw.TickFreeze¶
| Go | |
|---|---|
TickFreeze calls the tick_freeze slot.
Tick control (additive, gated by struct_size). Backed by a bridge-owned detour on Level::tick, installed lazily on the first control call and left in place (idle cost: one predictable branch per frame β a control call can arrive from a command handler that is executing INSIDE the tick, where unpatching would not be safe). Server thread only. While frozen, mobs/blocks/redstone/time stop; players can still move and chat (movement is client-authoritative, network runs outside the level tick).
- Parameters:
- on :
bool
- on :
- Return type:
(bool, error) - Slots:
tick_freeze
Raw.TickStep¶
| Go | |
|---|---|
TickStep calls the tick_step slot.
Only while frozen: queue exactly n extra frames. False if not frozen or n == 0.
- Parameters:
- n :
uint32
- n :
- Return type:
(bool, error) - Slots:
tick_step
Raw.TickWarp¶
| Go | |
|---|---|
TickWarp calls the tick_warp slot.
0 < factor <= 100. Fractional = slow motion (accumulator), 1.0 restores normal.
- Parameters:
- factor :
float64
- factor :
- Return type:
(bool, error) - Slots:
tick_warp
Raw.ProfileBegin¶
| Go | |
|---|---|
ProfileBegin calls the profile_begin slot.
Arm a window of ticks level ticks (1..12000). False if 0, too big, or already sampling.
- Parameters:
- ticks :
uint32
- ticks :
- Return type:
(bool, error) - Slots:
profile_begin
Raw.ProfileTake¶
| Go | |
|---|---|
ProfileTake calls the profile_take slot.
Poll for the finished report. False while sampling / nothing armed; true exactly once per window, sinking one SNBT report: {ticks:N, buckets:{level_tick:{us,calls}, dimension_tick:{β¦}, redstone:{β¦}, chunk_blocks:{β¦}, block_entities:{β¦}}}. Bucket times are INCLUSIVE (nested subsystems), report side by side, don't sum.
- Return type:
([]string, bool, error) - Slots:
profile_take
Raw.GetTps¶
| Go | |
|---|---|
GetTps calls the get_tps slot.
Ticks per second over the last window_seconds (1..60, clipped) of wall clock: the number of Level::tick calls that really ran divided by elapsed time. Stays correct under the tick warp (reads above 20), the tick freeze (reads 0) and lag (reads below 20). Returns -1.0 before the first frame has been sampled. Server thread only.
- Parameters:
- windowSeconds :
int32
- windowSeconds :
- Return type:
(float64, error) - Slots:
get_tps
Raw.GetMspt¶
| Go | |
|---|---|
GetMspt calls the get_mspt slot.
Milliseconds spent inside Level::tick per tick, averaged over the last window_seconds (1..60, clipped). This is the time the server computes, excluding the idle sleep between frames; a healthy server reads a few milliseconds and only approaches 50 when saturated. Returns -1.0 when no tick ran in the window. Server thread only.
- Parameters:
- windowSeconds :
int32
- windowSeconds :
- Return type:
(float64, error) - Slots:
get_mspt
World¶
Raw.SpawnParticle¶
| Go | |
|---|---|
SpawnParticle calls the spawn_particle slot.
Spawn a particle effect at a world coordinate. Used to outline a selection box edge-by-edge. Server thread only. Returns false if the level/dimension is not ready. dimension : 0 = overworld, 1 = nether, 2 = the end. effect_name : e.g. "minecraft:basic_flame_particle" or "minecraft:redstone_wire_dust_particle".
- Parameters:
- dimension :
int32 - effectName :
string - x :
float64 - y :
float64 - z :
float64
- dimension :
- Return type:
(bool, error) - Slots:
spawn_particle
Raw.SetBlock¶
| Go | |
|---|---|
SetBlock calls the set_block slot.
Place a block natively (BlockSource::setBlock, DEFAULT update flags). block_spec = "minecraft:stone" / "stone" (default state) or a full {name,states,...} SNBT. Unknown names fail instead of placing a placeholder.
- Parameters:
- dim :
int32 - x :
int32 - y :
int32 - z :
int32 - blockSpec :
string
- dim :
- Return type:
(bool, error) - Slots:
set_block
Raw.GetTime¶
| Go | |
|---|---|
GetTime calls the get_time slot.
World time (Level::getTime).
- Return type:
(int64, bool, error) - Slots:
get_time
Raw.SetTime¶
| Go | |
|---|---|
SetTime calls the set_time slot.
Set world time natively (Level::setTime).
- Parameters:
- t :
int64
- t :
- Return type:
(bool, error) - Slots:
set_time
Raw.SetWeather¶
| Go | |
|---|---|
SetWeather calls the set_weather slot.
0=clear 1=rain 2=thunder, native (Level::updateWeather).
- Parameters:
- weather :
int32
- weather :
- Return type:
(bool, error) - Slots:
set_weather
Raw.Explode¶
| Go | |
|---|---|
Explode calls the explode slot.
Level::explode. source may be 0 (no source actor).
- Parameters:
- dim :
int32 - x :
float64 - y :
float64 - z :
float64 - radius :
float32 - maxResistance :
float32 - source :
ActorID - fire :
bool - breaksBlocks :
bool - allowUnderwater :
bool
- dim :
- Return type:
(bool, error) - Slots:
explode
Raw.GetDifficulty¶
| Go | |
|---|---|
GetDifficulty calls the get_difficulty slot.
Server / world-level settings.
- Return type:
(int32, bool, error) - Slots:
get_difficulty
Raw.SetDifficulty¶
| Go | |
|---|---|
SetDifficulty calls the set_difficulty slot.
- Parameters:
- d :
int32
- d :
- Return type:
(bool, error) - Slots:
set_difficulty
Raw.GetSeed¶
| Go | |
|---|---|
GetSeed calls the get_seed slot.
- Return type:
(int64, bool, error) - Slots:
get_seed
Raw.GameRuleGet¶
| Go | |
|---|---|
GameRuleGet calls the game_rule_get slot.
out sink receives SNBT {type:"bool"|"int"|"float", value:β¦}; false if unknown rule.
- Parameters:
- name :
string
- name :
- Return type:
([]string, bool, error) - Slots:
game_rule_get
Raw.GameRuleSet¶
| Go | |
|---|---|
GameRuleSet calls the game_rule_set slot.
- Parameters:
- name :
string - value :
string
- name :
- Return type:
(bool, error) - Slots:
game_rule_set
Raw.SpawnParticleFor¶
| Go | |
|---|---|
SpawnParticleFor calls the spawn_particle_for slot.
Per-player particle packet (additive, gated by struct_size). Sends a SpawnParticleEffectPacket ONLY to the resolved player (Player::sendNetworkPacket) instead of Level::spawnParticleEffect's dimension-wide broadcast β other clients never receive it. dimension is the vanilla dimension id carried in the packet; pass the dimension the coordinates refer to (normally the player's own β clients don't render particles for another dimension). False if the player is offline / can't be resolved.
- Parameters:
- sel :
PlayerSel - dimension :
int32 - effectName :
string - x :
float64 - y :
float64 - z :
float64
- sel :
- Return type:
(bool, error) - Slots:
spawn_particle_for
Raw.Villages¶
| Go | |
|---|---|
Villages calls the villages slot.
Enumerate villages in a dimension. Each: {uuid, center:[x,y,z], bounds:{min,max}, poi_count}.
- Parameters:
- dimension :
int32
- dimension :
- Return type:
([]string, error) - Slots:
villages
Raw.StructuresNear¶
| Go | |
|---|---|
StructuresNear calls the structures_near slot.
Hardcoded spawn areas (nether fortress / witch hut / ocean monument / pillager outpost) whose chunks intersect a radius around (x,y,z). Each: {type, bounds:{min,max}}. Only LOADED chunks are inspected β a read-only query never force-loads.
- Parameters:
- dimension :
int32 - x :
int32 - y :
int32 - z :
int32 - radius :
int32
- dimension :
- Return type:
([]string, error) - Slots:
structures_near
Raw.LevelGetBiome¶
| Go | |
|---|---|
LevelGetBiome calls the level_get_biome slot.
Level: biome, spawn, save, weather, path, sleep (dedicated fns)
- Parameters:
- dim :
int32 - x :
int32 - y :
int32 - z :
int32
- dim :
- Return type:
([]string, bool, error) - Slots:
level_get_biome
Raw.LevelGetDefaultSpawn¶
| Go | |
|---|---|
LevelGetDefaultSpawn calls the level_get_default_spawn slot.
- Return type:
(int32, int32, int32, bool, error) - Slots:
level_get_default_spawn
Raw.LevelSetDefaultSpawn¶
| Go | |
|---|---|
LevelSetDefaultSpawn calls the level_set_default_spawn slot.
- Parameters:
- x :
int32 - y :
int32 - z :
int32
- x :
- Return type:
(bool, error) - Slots:
level_set_default_spawn
Raw.LevelSave¶
| Go | |
|---|---|
LevelSave calls the level_save slot.
- Return type:
(bool, error) - Slots:
level_save
Raw.LevelGetSleepStatus¶
| Go | |
|---|---|
LevelGetSleepStatus calls the level_get_sleep_status slot.
SNBT {sleeping, total_players, active_sleeping}
- Return type:
([]string, bool, error) - Slots:
level_get_sleep_status
Raw.LevelUpdateWeather¶
| Go | |
|---|---|
LevelUpdateWeather calls the level_update_weather slot.
- Parameters:
- rainLevel :
float32 - rainTime :
int32 - lightningLevel :
float32 - lightningTime :
int32
- rainLevel :
- Return type:
(bool, error) - Slots:
level_update_weather
Raw.LevelFindPath¶
| Go | |
|---|---|
LevelFindPath calls the level_find_path slot.
SNBT {nodes:[{x,y,z},β¦], reached:1b/0b}. NULL on every current host: pathfinding is not implemented.
- Parameters:
- id :
ActorID - x :
int32 - y :
int32 - z :
int32
- id :
- Return type:
([]string, bool, error) - Slots:
level_find_path
Raw.LevelDeleteChunkKeys¶
| Go | |
|---|---|
LevelDeleteChunkKeys calls the level_delete_chunk_keys slot.
Delete every save-file key belonging to one chunk, so the engine regenerates it from the generator on next load.
- Parameters:
- dim :
int32 - chunkX :
int32 - chunkZ :
int32
- dim :
- Return type:
(int32, error) - Slots:
level_delete_chunk_keys
Raw.LevelChunksLoaded¶
| Go | |
|---|---|
LevelChunksLoaded calls the level_chunks_loaded slot.
Are the chunks covering [min..max] currently loaded in memory?
- Parameters:
- dim :
int32 - minX :
int32 - minZ :
int32 - maxX :
int32 - maxZ :
int32
- dim :
- Return type:
(int32, error) - Slots:
level_chunks_loaded
Raw.LevelChunkKeys¶
| Go | |
|---|---|
LevelChunkKeys calls the level_chunk_keys slot.
List every save-file key belonging to one chunk. One callback per key.
- Parameters:
- dim :
int32 - chunkX :
int32 - chunkZ :
int32
- dim :
- Return type:
([]string, int32, error) - Slots:
level_chunk_keys
Raw.LevelDeleteKey¶
| Go | |
|---|---|
LevelDeleteKey calls the level_delete_key slot.
Delete one chunk-category key, verbatim.
- Parameters:
- key :
string
- key :
- Return type:
(bool, error) - Slots:
level_delete_key
Raw.LevelSetBiome¶
| Go | |
|---|---|
LevelSetBiome calls the level_set_biome slot.
Set the biome over an area.
- Parameters:
- dim :
int32 - minX :
int32 - minZ :
int32 - maxX :
int32 - maxZ :
int32 - biome :
string
- dim :
- Return type:
(int32, error) - Slots:
level_set_biome
Raw.GetExtraBlock¶
| Go | |
|---|---|
GetExtraBlock calls the get_extra_block slot.
Read the liquid layer. The sink receives a block name such as "minecraft:water"; an empty layer gives air.
- Parameters:
- dim :
int32 - x :
int32 - y :
int32 - z :
int32
- dim :
- Return type:
([]string, bool, error) - Slots:
get_extra_block
Raw.SetExtraBlock¶
| Go | |
|---|---|
SetExtraBlock calls the set_extra_block slot.
Write the liquid layer. block_spec takes a bare block name or full SNBT; write "minecraft:air" to clear it. update_flags is as in edit_set_block_nbt: bit 1 notifies neighbours, bit 2 syncs the client.
- Parameters:
- dim :
int32 - x :
int32 - y :
int32 - z :
int32 - blockSpec :
string - updateFlags :
int32
- dim :
- Return type:
(bool, error) - Slots:
set_extra_block
Bulk world editing¶
Raw.EditSetBlockNbt¶
| Go | |
|---|---|
EditSetBlockNbt calls the edit_set_block_nbt slot.
Write a block from serialized NBT ({name,states,version}, i.e. the shape get_block produces).
- Parameters:
- dim :
int32 - x :
int32 - y :
int32 - z :
int32 - snbt :
string - updateFlags :
int32
- dim :
- Return type:
(bool, error) - Slots:
edit_set_block_nbt
Raw.EditSetBlockStates¶
| Go | |
|---|---|
EditSetBlockStates calls the edit_set_block_states slot.
Write a block from a name + optional partial states. An empty states_snbt means all-default states; the version is taken from the default state on the loader side β the caller must not supply one.
- Parameters:
- dim :
int32 - x :
int32 - y :
int32 - z :
int32 - name :
string - statesSnbt :
string - updateFlags :
int32
- dim :
- Return type:
(bool, error) - Slots:
edit_set_block_states
Raw.EditSetBlockEntity¶
| Go | |
|---|---|
EditSetBlockEntity calls the edit_set_block_entity slot.
Write a block entity's NBT back (BlockActor::load). The cell must already hold the matching block.
- Parameters:
- dim :
int32 - x :
int32 - y :
int32 - z :
int32 - snbt :
string
- dim :
- Return type:
(bool, error) - Slots:
edit_set_block_entity
Raw.EditSpawnEntityNbt¶
| Go | |
|---|---|
EditSpawnEntityNbt calls the edit_spawn_entity_nbt slot.
Spawn an entity from full NBT (the inverse of actor_snapshot). When use_pos is true, (x,y,z) overrides the Pos tag; the UniqueID is reassigned by the engine and returned via out. NULL on every current host: the engine helper that gives a loaded actor a fresh UniqueID is inlined, and reusing the snapshot's own id makes the engine treat two actors as one.
- Parameters:
- dim :
int32 - snbt :
string - usePos :
bool - x :
float64 - y :
float64 - z :
float64
- dim :
- Return type:
(ActorID, bool, error) - Slots:
edit_spawn_entity_nbt
Raw.EditTraceRay¶
| Go | |
|---|---|
EditTraceRay calls the edit_trace_ray slot.
Ray trace yielding the BLOCK coordinate and hit face: {type, block:[x,y,z], facing, pos:[x,y,z], entity}.
- Parameters:
- id :
ActorID - maxDist :
float32 - includeActors :
bool - includeBlocks :
bool
- id :
- Return type:
([]string, bool, error) - Slots:
edit_trace_ray
Raw.EditFillRegion¶
| Go | |
|---|---|
EditFillRegion calls the edit_fill_region slot.
Fills a box with one block. block_spec is a bare name such as "minecraft:stone" or full SNBT; it is resolved once for the whole box. update_flags is as in edit_set_block_nbt: bit 1 notifies neighbours, bit 2 syncs the client; 0 is the fastest and leaves the client to catch up on the next chunk send. Returns the number of cells written, or -1 if the dimension is not ready, the spec does not resolve, or the box exceeds 2^24 cells. Server thread only.
- Parameters:
- dimension :
int32 - x1 :
int32 - y1 :
int32 - z1 :
int32 - x2 :
int32 - y2 :
int32 - z2 :
int32 - blockSpec :
string - updateFlags :
int32
- dimension :
- Return type:
(int64, error) - Slots:
edit_fill_region
Players¶
Raw.GetPlayerPosition¶
| Go | |
|---|---|
GetPlayerPosition calls the get_player_position slot.
Look up a connected player's feet position and dimension by name. Used to pick selection corners from where the player is standing. Server thread only.
- Parameters:
- name :
string
- name :
- Return type:
(PlayerPos, error) - Slots:
get_player_position
Raw.ListPlayers¶
| Go | |
|---|---|
ListPlayers calls the list_players slot.
One SNBT per online player: {name,xuid,uuid,dim,x,y,z}.
- Return type:
([]string, error) - Slots:
list_players
Raw.PlayerResolve¶
| Go | |
|---|---|
PlayerResolve calls the player_resolve slot.
Resolve a player selector to their ActorUniqueID (bridges into the actor_* API).
- Parameters:
- sel :
PlayerSel
- sel :
- Return type:
(ActorID, bool, error) - Slots:
player_resolve
Raw.PlayerSendMessage¶
| Go | |
|---|---|
PlayerSendMessage calls the player_send_message slot.
- Parameters:
- sel :
PlayerSel - msg :
string
- sel :
- Return type:
(bool, error) - Slots:
player_send_message
Raw.PlayerDisconnect¶
| Go | |
|---|---|
PlayerDisconnect calls the player_disconnect slot.
- Parameters:
- sel :
PlayerSel - reason :
string
- sel :
- Return type:
(bool, error) - Slots:
player_disconnect
Raw.BroadcastMessage¶
| Go | |
|---|---|
BroadcastMessage calls the broadcast_message slot.
sendMessage to every online player.
- Parameters:
- msg :
string
- msg :
- Return type:
error - Slots:
broadcast_message
Raw.PlayerSetGamemode¶
| Go | |
|---|---|
PlayerSetGamemode calls the player_set_gamemode slot.
0=survival 1=creative 2=adventure 6=spectator, native (Player::setPlayerGameType).
- Parameters:
- sel :
PlayerSel - mode :
int32
- sel :
- Return type:
(bool, error) - Slots:
player_set_gamemode
Raw.PlayerTeleport¶
| Go | |
|---|---|
PlayerTeleport calls the player_teleport slot.
Teleport natively (Actor::teleport). Custom dimensions (id >= 3) are allowed; the dimension bridge must produce an engine instance whose id matches, or the call fails instead of sending the player into a mismatched dimension.
- Parameters:
- sel :
PlayerSel - dim :
int32 - x :
float64 - y :
float64 - z :
float64
- sel :
- Return type:
(bool, error) - Slots:
player_teleport
Raw.PlayerGetNum¶
| Go | |
|---|---|
PlayerGetNum calls the player_get_num slot.
The four *_get_num slots share one convention. The return is whether the host has an answer, and *out is the answer; a false leaves *out untouched.
- Parameters:
- sel :
PlayerSel - prop :
int32
- sel :
- Return type:
(float64, bool, error) - Slots:
player_get_num
Raw.PlayerGetStr¶
| Go | |
|---|---|
PlayerGetStr calls the player_get_str slot.
- Parameters:
- sel :
PlayerSel - prop :
int32
- sel :
- Return type:
([]string, bool, error) - Slots:
player_get_str
Raw.PlayerSetNum¶
| Go | |
|---|---|
PlayerSetNum calls the player_set_num slot.
- Parameters:
- sel :
PlayerSel - prop :
int32 - v :
float64
- sel :
- Return type:
(bool, error) - Slots:
player_set_num
Raw.PlayerAction¶
| Go | |
|---|---|
PlayerAction calls the player_action slot.
- Parameters:
- sel :
PlayerSel - action :
int32 - sarg :
string - a :
float64 - b :
float64 - c :
float64
- sel :
- Return type:
([]string, bool, error) - Slots:
player_action
Raw.PlayerSendMessageTyped¶
| Go | |
|---|---|
PlayerSendMessageTyped calls the player_send_message_typed slot.
Send a message of a specific TextPacketType to one player (additive, gated by struct_size). type is a TextPacketType value: 0 Raw Β· 1 Chat Β· 2 Translate Β· 3 Popup Β· 4 JukeboxPopup Β· 5 Tip Β· 6 SystemMessage Β· 7 Whisper Β· 8 Announcement Β· 9 TextObjectWhisper Β· 10 TextObject Β· 11 TextObjectAnnouncement. Out-of-range falls back to Raw. Single-string body (like LSE tell): the author/param kinds (Chat/Whisper/Translate) arrive as plain text. plain player_send_message remains the Raw/Chat convenience path.
- Parameters:
- sel :
PlayerSel - msg :
string - typeArg :
int32
- sel :
- Return type:
(bool, error) - Slots:
player_send_message_typed
Raw.PlayerGetCarriedItem¶
| Go | |
|---|---|
PlayerGetCarriedItem calls the player_get_carried_item slot.
Player: equipment, cooldown, network (dedicated fns)
- Parameters:
- sel :
PlayerSel
- sel :
- Return type:
([]string, bool, error) - Slots:
player_get_carried_item
Raw.PlayerGetItem¶
| Go | |
|---|---|
PlayerGetItem calls the player_get_item slot.
- Parameters:
- sel :
PlayerSel - slot :
int32
- sel :
- Return type:
([]string, bool, error) - Slots:
player_get_item
Raw.PlayerSetItem¶
| Go | |
|---|---|
PlayerSetItem calls the player_set_item slot.
- Parameters:
- sel :
PlayerSel - slot :
int32 - itemSnbt :
string
- sel :
- Return type:
(bool, error) - Slots:
player_set_item
Raw.PlayerGetEquipment¶
| Go | |
|---|---|
PlayerGetEquipment calls the player_get_equipment slot.
All equipment as SNBT: [{slot, item_snbt},β¦] slot: 0=mainhand 1=offhand 2-5=armor
- Parameters:
- sel :
PlayerSel
- sel :
- Return type:
([]string, bool, error) - Slots:
player_get_equipment
Raw.PlayerGetCooldown¶
| Go | |
|---|---|
PlayerGetCooldown calls the player_get_cooldown slot.
Ticks remaining for an item cooldown (-1 if not on cooldown / player offline).
- Parameters:
- sel :
PlayerSel - itemName :
string
- sel :
- Return type:
(int32, error) - Slots:
player_get_cooldown
Raw.PlayerStartCooldown¶
| Go | |
|---|---|
PlayerStartCooldown calls the player_start_cooldown slot.
- Parameters:
- sel :
PlayerSel - itemName :
string - ticks :
int32
- sel :
- Return type:
(bool, error) - Slots:
player_start_cooldown
Raw.PlayerGetNetworkStatus¶
| Go | |
|---|---|
PlayerGetNetworkStatus calls the player_get_network_status slot.
- Parameters:
- sel :
PlayerSel
- sel :
- Return type:
([]string, bool, error) - Slots:
player_get_network_status
Raw.PlayerSendTitle¶
| Go | |
|---|---|
PlayerSendTitle calls the player_send_title slot.
Titles PACT_SET_TITLE (player_action opcode 6) reaches the client by running the console command title "<name>" title <text>. Three things are wrong with that and none of them are theoretical: - the text is pasted into a command line unquoted, so a plot named He said "hi" truncates the command; - title's text parameter is a message, which expands selectors β a plot named @e is a command injection, not a name; - /title has no way to set fade/stay for the same call, so timing is whatever the client last stored. This slot builds a real SetTitlePacket instead. No wire format crosses the FFI (the packet is constructed field-by-field on this side), so it survives protocol bumps the way spawn_particle_for does.
- Parameters:
- sel :
PlayerSel - typeArg :
int32 - text :
string - fadeInTicks :
int32 - stayTicks :
int32 - fadeOutTicks :
int32
- sel :
- Return type:
(bool, error) - Slots:
player_send_title
Raw.PlayerConnId¶
| Go | |
|---|---|
PlayerConnId calls the player_conn_id slot.
This player's connection id β the same number packet interceptors see in the packet context.
- Parameters:
- who :
PlayerSel
- who :
- Return type:
(uint64, error) - Slots:
player_conn_id
Actors¶
Raw.ActorSnapshot¶
| Go | |
|---|---|
ActorSnapshot calls the actor_snapshot slot.
Full Actor::save NBT as SNBT.
- Parameters:
- id :
ActorID
- id :
- Return type:
([]string, bool, error) - Slots:
actor_snapshot
Raw.ActorGetNum¶
| Go | |
|---|---|
ActorGetNum calls the actor_get_num slot.
- Parameters:
- id :
ActorID - prop :
int32
- id :
- Return type:
(float64, bool, error) - Slots:
actor_get_num
Raw.ActorGetStr¶
| Go | |
|---|---|
ActorGetStr calls the actor_get_str slot.
- Parameters:
- id :
ActorID - prop :
int32
- id :
- Return type:
([]string, bool, error) - Slots:
actor_get_str
Raw.ActorAction¶
| Go | |
|---|---|
ActorAction calls the actor_action slot.
- Parameters:
- id :
ActorID - action :
int32 - sarg :
string - a :
float64 - b :
float64 - c :
float64
- id :
- Return type:
([]string, bool, error) - Slots:
actor_action
Raw.SpawnMob¶
| Go | |
|---|---|
SpawnMob calls the spawn_mob slot.
Spawn a mob (Spawner::spawnMob); on success *out = its ActorUniqueID.
- Parameters:
- dim :
int32 - typeName :
string - x :
float64 - y :
float64 - z :
float64
- dim :
- Return type:
(ActorID, bool, error) - Slots:
spawn_mob
Raw.ActorGetVehicle¶
| Go | |
|---|---|
ActorGetVehicle calls the actor_get_vehicle slot.
Actor: relationships, equipment, effects, geometry (dedicated fns)
- Parameters:
- id :
ActorID
- id :
- Return type:
(ActorID, bool, error) - Slots:
actor_get_vehicle
Raw.ActorGetFirstPassenger¶
| Go | |
|---|---|
ActorGetFirstPassenger calls the actor_get_first_passenger slot.
- Parameters:
- id :
ActorID
- id :
- Return type:
(ActorID, bool, error) - Slots:
actor_get_first_passenger
Raw.ActorGetOwner¶
| Go | |
|---|---|
ActorGetOwner calls the actor_get_owner slot.
- Parameters:
- id :
ActorID
- id :
- Return type:
(ActorID, bool, error) - Slots:
actor_get_owner
Raw.ActorGetTarget¶
| Go | |
|---|---|
ActorGetTarget calls the actor_get_target slot.
- Parameters:
- id :
ActorID
- id :
- Return type:
(ActorID, bool, error) - Slots:
actor_get_target
Raw.ActorGetEquippedItem¶
| Go | |
|---|---|
ActorGetEquippedItem calls the actor_get_equipped_item slot.
slot: 0=mainhand 1=offhand 2=helmet 3=chestplate 4=leggings 5=boots
- Parameters:
- id :
ActorID - slot :
int32
- id :
- Return type:
([]string, bool, error) - Slots:
actor_get_equipped_item
Raw.ActorSetEquippedItem¶
| Go | |
|---|---|
ActorSetEquippedItem calls the actor_set_equipped_item slot.
- Parameters:
- id :
ActorID - slot :
int32 - itemSnbt :
string
- id :
- Return type:
(bool, error) - Slots:
actor_set_equipped_item
Raw.ActorGetEffects¶
| Go | |
|---|---|
ActorGetEffects calls the actor_get_effects slot.
SNBT [{id, ticks, amplifier, visible},β¦]
- Parameters:
- id :
ActorID
- id :
- Return type:
([]string, bool, error) - Slots:
actor_get_effects
Raw.ActorGetStatusFlag¶
| Go | |
|---|---|
ActorGetStatusFlag calls the actor_get_status_flag slot.
flag_index: ActorFlags enum value (0-based).
- Parameters:
- id :
ActorID - flagIndex :
int32
- id :
- Return type:
(bool, error) - Slots:
actor_get_status_flag
Raw.ActorSetStatusFlag¶
| Go | |
|---|---|
ActorSetStatusFlag calls the actor_set_status_flag slot.
- Parameters:
- id :
ActorID - flagIndex :
int32 - value :
bool
- id :
- Return type:
(bool, error) - Slots:
actor_set_status_flag
Raw.ActorTraceRay¶
| Go | |
|---|---|
ActorTraceRay calls the actor_trace_ray slot.
SNBT {type:"entity"|"block"|"none", pos:[x,y,z], entity_id?, block_name?}
- Parameters:
- id :
ActorID - maxDist :
float32 - includeActors :
bool - includeBlocks :
bool
- id :
- Return type:
([]string, bool, error) - Slots:
actor_trace_ray
Raw.ActorDistanceTo¶
| Go | |
|---|---|
ActorDistanceTo calls the actor_distance_to slot.
- Parameters:
- id :
ActorID - other :
ActorID
- id :
- Return type:
(float64, bool, error) - Slots:
actor_distance_to
Raw.ActorGetAabb¶
| Go | |
|---|---|
ActorGetAabb calls the actor_get_aabb slot.
SNBT {min:[x,y,z], max:[x,y,z]}
- Parameters:
- id :
ActorID
- id :
- Return type:
([]string, bool, error) - Slots:
actor_get_aabb
Raw.ActorClone¶
| Go | |
|---|---|
ActorClone calls the actor_clone slot.
- Parameters:
- id :
ActorID - dim :
int32 - x :
float64 - y :
float64 - z :
float64
- id :
- Return type:
(ActorID, bool, error) - Slots:
actor_clone
Blocks¶
Raw.BlockGetNum¶
| Go | |
|---|---|
BlockGetNum calls the block_get_num slot.
Β§D blocks & block entities
- Parameters:
- dim :
int32 - x :
int32 - y :
int32 - z :
int32 - prop :
int32
- dim :
- Return type:
(float64, bool, error) - Slots:
block_get_num
Raw.BlockGetStr¶
| Go | |
|---|---|
BlockGetStr calls the block_get_str slot.
- Parameters:
- dim :
int32 - x :
int32 - y :
int32 - z :
int32 - prop :
int32
- dim :
- Return type:
([]string, bool, error) - Slots:
block_get_str
Raw.BlockAction¶
| Go | |
|---|---|
BlockAction calls the block_action slot.
- Parameters:
- dim :
int32 - x :
int32 - y :
int32 - z :
int32 - action :
int32 - sarg :
string
- dim :
- Return type:
([]string, bool, error) - Slots:
block_action
Raw.BlockEntitySnbt¶
| Go | |
|---|---|
BlockEntitySnbt calls the block_entity_snbt slot.
BlockActor::save (with default SaveContext) as SNBT; false if none there.
- Parameters:
- dim :
int32 - x :
int32 - y :
int32 - z :
int32
- dim :
- Return type:
([]string, bool, error) - Slots:
block_entity_snbt
Raw.BlockGetState¶
| Go | |
|---|---|
BlockGetState calls the block_get_state slot.
Block: state get/set, collision shape (dedicated fns)
- Parameters:
- dim :
int32 - x :
int32 - y :
int32 - z :
int32 - stateName :
string
- dim :
- Return type:
([]string, bool, error) - Slots:
block_get_state
Raw.BlockSetState¶
| Go | |
|---|---|
BlockSetState calls the block_set_state slot.
- Parameters:
- dim :
int32 - x :
int32 - y :
int32 - z :
int32 - stateName :
string - value :
string
- dim :
- Return type:
(bool, error) - Slots:
block_set_state
Raw.BlockGetCollisionShape¶
| Go | |
|---|---|
BlockGetCollisionShape calls the block_get_collision_shape slot.
- Parameters:
- dim :
int32 - x :
int32 - y :
int32 - z :
int32
- dim :
- Return type:
([]string, bool, error) - Slots:
block_get_collision_shape
Items and containers¶
Raw.ItemGetNum¶
| Go | |
|---|---|
ItemGetNum calls the item_get_num slot.
Β§E items (SNBT value objects) & containers
- Parameters:
- itemSnbt :
string - prop :
int32
- itemSnbt :
- Return type:
(float64, bool, error) - Slots:
item_get_num
Raw.ItemGetStr¶
| Go | |
|---|---|
ItemGetStr calls the item_get_str slot.
- Parameters:
- itemSnbt :
string - prop :
int32
- itemSnbt :
- Return type:
([]string, bool, error) - Slots:
item_get_str
Raw.ItemTransform¶
| Go | |
|---|---|
ItemTransform calls the item_transform slot.
Rebuild β mutate β serialize; out receives the NEW item SNBT.
- Parameters:
- itemSnbt :
string - op :
int32 - sarg :
string - narg :
float64
- itemSnbt :
- Return type:
([]string, bool, error) - Slots:
item_transform
Raw.ContainerSize¶
| Go | |
|---|---|
ContainerSize calls the container_size slot.
- Parameters:
- ref :
ContainerRef
- ref :
- Return type:
(int32, bool, error) - Slots:
container_size
Raw.ContainerGetItem¶
| Go | |
|---|---|
ContainerGetItem calls the container_get_item slot.
Slot content as item SNBT (empty slots yield the air item's SNBT).
- Parameters:
- ref :
ContainerRef - slot :
int32
- ref :
- Return type:
([]string, bool, error) - Slots:
container_get_item
Raw.ContainerSetItem¶
| Go | |
|---|---|
ContainerSetItem calls the container_set_item slot.
- Parameters:
- ref :
ContainerRef - slot :
int32 - itemSnbt :
string
- ref :
- Return type:
(bool, error) - Slots:
container_set_item
Raw.ContainerAddItem¶
| Go | |
|---|---|
ContainerAddItem calls the container_add_item slot.
- Parameters:
- ref :
ContainerRef - itemSnbt :
string
- ref :
- Return type:
(bool, error) - Slots:
container_add_item
Raw.ContainerRemoveItem¶
| Go | |
|---|---|
ContainerRemoveItem calls the container_remove_item slot.
- Parameters:
- ref :
ContainerRef - slot :
int32 - count :
int32
- ref :
- Return type:
(bool, error) - Slots:
container_remove_item
Raw.ContainerClear¶
| Go | |
|---|---|
ContainerClear calls the container_clear slot.
- Parameters:
- ref :
ContainerRef
- ref :
- Return type:
(bool, error) - Slots:
container_clear
Raw.ItemGetEnchants¶
| Go | |
|---|---|
ItemGetEnchants calls the item_get_enchants slot.
SNBT [{id, level},β¦]
- Parameters:
- itemSnbt :
string
- itemSnbt :
- Return type:
([]string, bool, error) - Slots:
item_get_enchants
Raw.ItemSetEnchants¶
| Go | |
|---|---|
ItemSetEnchants calls the item_set_enchants slot.
enchants_snbt = [{id, level},β¦]; out = new item SNBT. NULL on every current host: writing enchantments is not implemented, and item_get_enchants is the read side.
- Parameters:
- itemSnbt :
string - enchantsSnbt :
string
- itemSnbt :
- Return type:
([]string, bool, error) - Slots:
item_set_enchants
Raw.ItemMatches¶
| Go | |
|---|---|
ItemMatches calls the item_matches slot.
- Parameters:
- a :
string - b :
string
- a :
- Return type:
(bool, error) - Slots:
item_matches
Raw.ItemGetUserData¶
| Go | |
|---|---|
ItemGetUserData calls the item_get_user_data slot.
- Parameters:
- itemSnbt :
string
- itemSnbt :
- Return type:
([]string, bool, error) - Slots:
item_get_user_data
Raw.ContainerRefresh¶
| Go | |
|---|---|
ContainerRefresh calls the container_refresh slot.
Resend a player-owned container (which 0..3) to its owner. Returns false for block containers (which == 4) β a chest has no single owner to resend to; its viewers are refreshed by the engine's own container transaction path.
- Parameters:
- ref :
ContainerRef
- ref :
- Return type:
(bool, error) - Slots:
container_refresh
Scoreboard¶
Raw.ScoreboardOp¶
| Go | |
|---|---|
ScoreboardOp calls the scoreboard_op slot.
Β§F scoreboard
- Parameters:
- op :
int32 - a :
string - b :
string - n :
int64
- op :
- Return type:
([]string, bool, error) - Slots:
scoreboard_op
NBT and the key-value database¶
Raw.NbtBinaryToSnbt¶
| Go | |
|---|---|
NbtBinaryToSnbt calls the nbt_binary_to_snbt slot.
- Parameters:
- data :
[]byte - fmt :
int32
- data :
- Return type:
([]string, bool, error) - Slots:
nbt_binary_to_snbt
Raw.KvdbOpen¶
| Go | |
|---|---|
KvdbOpen calls the kvdb_open slot.
KvDb: THREAD-SAFE (internal mutex). Paths are confined to the mod's own data directory; ".." and absolute paths are rejected. Handles are owned by the loader and force-closed (with a warning) at mod unload.
- Parameters:
- path :
string - createIfMissing :
bool
- path :
- Return type:
(KvDbHandle, error) - Slots:
kvdb_open
Raw.KvdbClose¶
| Go | |
|---|---|
KvdbClose calls the kvdb_close slot.
- Parameters:
- hArg :
KvDbHandle
- hArg :
- Return type:
error - Slots:
kvdb_close
Raw.KvdbGet¶
| Go | |
|---|---|
KvdbGet calls the kvdb_get slot.
- Parameters:
- hArg :
KvDbHandle - key :
string
- hArg :
- Return type:
([]string, bool, error) - Slots:
kvdb_get
Raw.KvdbSet¶
| Go | |
|---|---|
KvdbSet calls the kvdb_set slot.
- Parameters:
- hArg :
KvDbHandle - key :
string - value :
string
- hArg :
- Return type:
(bool, error) - Slots:
kvdb_set
Raw.KvdbDel¶
| Go | |
|---|---|
KvdbDel calls the kvdb_del slot.
- Parameters:
- hArg :
KvDbHandle - key :
string
- hArg :
- Return type:
(bool, error) - Slots:
kvdb_del
Raw.KvdbHas¶
| Go | |
|---|---|
KvdbHas calls the kvdb_has slot.
- Parameters:
- hArg :
KvDbHandle - key :
string
- hArg :
- Return type:
(bool, error) - Slots:
kvdb_has
Raw.KvdbIsEmpty¶
| Go | |
|---|---|
KvdbIsEmpty calls the kvdb_is_empty slot.
- Parameters:
- hArg :
KvDbHandle
- hArg :
- Return type:
(bool, error) - Slots:
kvdb_is_empty
Economy¶
Raw.GetMoney¶
| Go | |
|---|---|
GetMoney calls the get_money slot.
Balance. Returns -1 on failure (empty xuid, database error, or absent backend); a real balance is never negative, so < 0 means "cannot say". Note that it opens an account at the configured default for an unseen xuid, so this is not a side-effect-free read.
- Parameters:
- xuid :
string
- xuid :
- Return type:
(int64, error) - Slots:
get_money
Raw.SetMoney¶
| Go | |
|---|---|
SetMoney calls the set_money slot.
Set to money, which is a target balance rather than a delta.
- Parameters:
- xuid :
string - money :
int64
- xuid :
- Return type:
(bool, error) - Slots:
set_money
Raw.AddMoney¶
| Go | |
|---|---|
AddMoney calls the add_money slot.
- Parameters:
- xuid :
string - money :
int64
- xuid :
- Return type:
(bool, error) - Slots:
add_money
Raw.ReduceMoney¶
| Go | |
|---|---|
ReduceMoney calls the reduce_money slot.
- Parameters:
- xuid :
string - money :
int64
- xuid :
- Return type:
(bool, error) - Slots:
reduce_money
Raw.TransMoney¶
| Go | |
|---|---|
TransMoney calls the trans_money slot.
An empty from or to means created from or destroyed into nothing. What the payee receives is reduced by pay_tax (see above). from == to fails.
- Parameters:
- from :
string - to :
string - val :
int64 - note :
string
- from :
- Return type:
(bool, error) - Slots:
trans_money
Raw.MoneyGetHist¶
| Go | |
|---|---|
MoneyGetHist calls the money_get_hist slot.
- Parameters:
- xuid :
string - timediff :
int32
- xuid :
- Return type:
([]string, error) - Slots:
money_get_hist
Raw.MoneyClearHist¶
| Go | |
|---|---|
MoneyClearHist calls the money_clear_hist slot.
- Parameters:
- difftime :
int32
- difftime :
- Return type:
error - Slots:
money_clear_hist
Raw.MoneyRanking¶
| Go | |
|---|---|
MoneyRanking calls the money_ranking slot.
- Parameters:
- num :
uint16
- num :
- Return type:
([]string, error) - Slots:
money_ranking
Packets¶
Raw.SendPacket¶
| Go | |
|---|---|
SendPacket calls the send_packet slot.
Raw per-connection packet send (additive, gated by struct_size) β the generic primitive spawn_particle_for derives from. packet_id is a MinecraftPacketIds value; body/body_len is the packet's wire-format body for the CURRENT game version. The bridge deserializes it into a real packet object (MinecraftPackets::createPacket + Packet::read) and delivers it to the resolved player's connection only. False if: player offline, unknown/unconstructible id, body fails to parse, or bytes are left over after parsing (wrong shape for this version). ESCAPE HATCH: the wire format is version-specific and is the caller's responsibility; prefer typed entries when one exists.
- Parameters:
- sel :
PlayerSel - packetId :
int32 - body :
[]byte
- sel :
- Return type:
(bool, error) - Slots:
send_packet
Raw.PacketHookUnregister¶
| Go | |
|---|---|
PacketHookUnregister calls the packet_hook_unregister slot.
Unregister. Safe to call from inside the callback.
- Parameters:
- handleArg :
PacketHookHandle
- handleArg :
- Return type:
(bool, error) - Slots:
packet_hook_unregister
Raw.PacketConnHookUnregister¶
| Go | |
|---|---|
PacketConnHookUnregister calls the packet_conn_hook_unregister slot.
Unregister. Safe to call from inside the callback.
- Parameters:
- handleArg :
PacketHookHandle
- handleArg :
- Return type:
(bool, error) - Slots:
packet_conn_hook_unregister
Simulated players¶
Raw.SimSpawn¶
| Go | |
|---|---|
SimSpawn calls the sim_spawn slot.
Simulated ("fake") players (additive, gated by struct_size). sim_spawn creates a real ServerPlayer with that name β every existing per-player entry (teleport, health, inventory, kick,β¦) works on it via the usual name selector. sim_do multiplexes the simulate* verb family: the action vocabulary grows bridge-side without new table slots (verbs: despawn stop jump attack interact use_item drop respawn move_to navigate_to look_at destroy_block destroy_look stop_destroy interact_block sneak fly chat β args as SNBT, see docs). Gated on isSimulatedPlayer(): a real player can never be puppeted. False on unknown verb, malformed args, offline/non-sim target.
- Parameters:
- name :
string - dimension :
int32 - x :
float64 - y :
float64 - z :
float64
- name :
- Return type:
(bool, error) - Slots:
sim_spawn
Raw.SimDo¶
| Go | |
|---|---|
SimDo calls the sim_do slot.
- Parameters:
- sel :
PlayerSel - action :
string - argsSnbt :
string
- sel :
- Return type:
(bool, error) - Slots:
sim_do
Raw.SimIs¶
| Go | |
|---|---|
SimIs calls the sim_is slot.
True if the selector resolves to a live simulated player. Lets a mod re-validate a bot after a restart (the SimulatedPlayer persists in the world, but in-memory handles don't).
- Parameters:
- sel :
PlayerSel
- sel :
- Return type:
(bool, error) - Slots:
sim_is
Raw.SimList¶
| Go | |
|---|---|
SimList calls the sim_list slot.
Enumerate the names of all live simulated players (sink receives each name). Rebuild a handle from a name to drive a bot that outlived the session that spawned it.
- Return type:
([]string, error) - Slots:
sim_list
Client¶
Raw.ClientGetLocalPlayer¶
| Go | |
|---|---|
ClientGetLocalPlayer calls the client_get_local_player slot.
Local player's name via ll::service::getClientInstance()->getLocalPlayer(). sink receives the name, or the call returns false if not in a level.
- Return type:
([]string, bool, error) - Slots:
client_get_local_player
Raw.ClientIsInLevel¶
| Go | |
|---|---|
ClientIsInLevel calls the client_is_in_level slot.
True when the client is inside a level (a world is loaded).
- Return type:
(bool, error) - Slots:
client_is_in_level
Raw.ClientGetScreenName¶
| Go | |
|---|---|
ClientGetScreenName calls the client_get_screen_name slot.
Current screen / UI name (e.g. "hud_screen", "pause_screen"). NULL on every current host, client builds included: the engine exposes no stable accessor for it.
- Return type:
([]string, bool, error) - Slots:
client_get_screen_name
Raw.ClientUnregisterKey¶
| Go | |
|---|---|
ClientUnregisterKey calls the client_unregister_key slot.
Unregister a key binding: this mod's handler stops firing and the handle is freed. The ll::input::KeyHandle itself is not destroyed, since the key registry keeps one key per name and offers no removal; registering the same name again reuses that key.
- Parameters:
- handleArg :
KeyHandle
- handleArg :
- Return type:
(bool, error) - Slots:
client_unregister_key
Raw.ClientGetKeyCodes¶
| Go | |
|---|---|
ClientGetKeyCodes calls the client_get_key_codes slot.
Currently assigned key codes (may differ from defaults if remapped). sink receives a JSON-style array string "[1,2,3]".
- Parameters:
- handleArg :
KeyHandle
- handleArg :
- Return type:
([]string, bool, error) - Slots:
client_get_key_codes
Custom dimensions¶
Raw.MdIsAvailable¶
| Go | |
|---|---|
MdIsAvailable calls the md_is_available slot.
Whether this host can register custom dimensions. NULL when pier-dimensions was not built in. Filled in, it answers from a probe of the engine's dimension definition table, so it can be false on an engine whose layout this build does not match; the answer is cached after the first call that can make it.
- Return type:
(bool, error) - Slots:
md_is_available
Raw.MdSetDimensionRule¶
| Go | |
|---|---|
MdSetDimensionRule calls the md_set_dimension_rule slot.
Per-dimension rules, consulted by the loader's own hooks.
- Parameters:
- dimension :
int32 - rule :
int32 - allow :
bool
- dimension :
- Return type:
error - Slots:
md_set_dimension_rule
Raw.MdGetDimensionRule¶
| Go | |
|---|---|
MdGetDimensionRule calls the md_get_dimension_rule slot.
Read back a rule. outAllow is only written when the dimension has an explicit entry for that rule; returns false otherwise. A rule number this host does not know is answered false as well, and md_set_dimension_rule ignores one, so a binding newer than the host cannot tell "not set" from "not supported" here.
- Parameters:
- dimension :
int32 - rule :
int32
- dimension :
- Return type:
(bool, bool, error) - Slots:
md_get_dimension_rule
Raw.MdClearDimensionRules¶
| Go | |
|---|---|
MdClearDimensionRules calls the md_clear_dimension_rules slot.
Drop every rule for a dimension (used when a world is deleted).
- Parameters:
- dimension :
int32
- dimension :
- Return type:
error - Slots:
md_clear_dimension_rules
Raw.MdGetDimensionId¶
| Go | |
|---|---|
MdGetDimensionId calls the md_get_dimension_id slot.
Resolve a dimension name to its id. Returns -1 if not found.
- Parameters:
- name :
string
- name :
- Return type:
(int32, error) - Slots:
md_get_dimension_id
Raw.MdSetPlotMerges¶
| Go | |
|---|---|
MdSetPlotMerges calls the md_set_plot_merges slot.
Replace a dimension's merge markers wholesale. entries is count triples (x, z, mask), i.e. count * 3 int32s; mask is a bitset of 1=north, 2=east, 4=south, 8=west matching the plugin's merged[] indices. Only plots that actually carry a marker need to be sent.
- Parameters:
- dimension :
int32 - entries :
[]int32
- dimension :
- Return type:
error - Slots:
md_set_plot_merges
Raw.MdListDimensions¶
| Go | |
|---|---|
MdListDimensions calls the md_list_dimensions slot.
List every registered custom dimension as a JSON array: [{"name":"plot_world","dim":1000,"snbt":"{β¦}"}].
- Return type:
([]string, error) - Slots:
md_list_dimensions
Raw.MdAddDimension¶
| Go | |
|---|---|
MdAddDimension calls the md_add_dimension slot.
Add a custom dimension with a native terrain from one declarative spec.
- Parameters:
- name :
string - specSnbt :
string
- name :
- Return type:
(int32, error) - Slots:
md_add_dimension
Raw.MdAddDimensionPack¶
| Go | |
|---|---|
MdAddDimensionPack calls the md_add_dimension_pack slot.
Add a custom dimension whose terrain is a terrain pack: a directory with a config file and a binary built by tools/pier-pack. config_path names the config relative to the server root, forward slashes, no ".." and not absolute; the binary is named inside the config relative to it.
- Parameters:
- name :
string - configPath :
string - specSnbt :
string
- name :
- Return type:
(int32, error) - Slots:
md_add_dimension_pack
Raw.MdPackInspect¶
| Go | |
|---|---|
MdPackInspect calls the md_pack_inspect slot.
What a pack asks for, without registering anything: the sink receives one JSON document, the same shape pier-pack inspect prints: {"ok":true,"kind":"template","pack":"...","sha256":"...","name":"...", "biome":"...","height":{"min":-512,"max":320,"fixed":false}, "params":[{"name":"plot_size","kind":"free","default":64,"min":4, "max":512,"step":1}, {"name":"wall_style","kind":"choice","default":0,"choices":[0,1]}, {"name":"plot_depth","kind":"derived"}, {"name":"size","kind":"fixed","value":256}], "roles":[{"name":"floor","default":"minecraft:grass_block"}], "zones":["interior","border","road"], "constraints":["..."], "shapes":23, "picks":1, "voxels":[{"size":[5,4,3],"palette":5}], "confine":true} A mod builds its form from "params": free is a slider, choice a list, fixed a read-only value, derived is not shown. On a refusal the sink receives {"ok":false,"status":<code>,"problems":["..."]} and the code is returned. Returns 0 or a PIER_PACK_* code. Server thread only.
- Parameters:
- configPath :
string
- configPath :
- Return type:
([]string, int32, error) - Slots:
md_pack_inspect
Raw.MdRetireDimension¶
| Go | |
|---|---|
MdRetireDimension calls the md_retire_dimension slot.
Retire a custom dimension: drop it from dimension_config.json, from the host's own tables and from the dimension factory, so nothing registers it on the next boot and it stops appearing in md_list_dimensions.
- Parameters:
- name :
string
- name :
- Return type:
(bool, error) - Slots:
md_retire_dimension
Raw.MdSetDimensionCells¶
| Go | |
|---|---|
MdSetDimensionCells calls the md_set_dimension_cells slot.
Give a generated dimension the cell geometry its confinement rules use.
- Parameters:
- dimId :
int32 - cell :
int32 - gap :
int32
- dimId :
- Return type:
(bool, error) - Slots:
md_set_dimension_cells
Cross-mod: bus, services and lanes¶
Raw.BusUnsubscribe¶
| Go | |
|---|---|
BusUnsubscribe calls the bus_unsubscribe slot.
Drop one of this mod's subscriptions. Scoped to the caller β a mod cannot unsubscribe another mod. Returns true if one was removed. Safe to call from inside a callback (including one's own).
- Parameters:
- subId :
uint64
- subId :
- Return type:
(bool, error) - Slots:
bus_unsubscribe
Raw.BusPublish¶
| Go | |
|---|---|
BusPublish calls the bus_publish slot.
Deliver payload to every *other* mod subscribed to topic. Returns how many subscribers actually ran (0 is normal β nobody is listening). Return values from subscribers are ignored.
- Parameters:
- topic :
string - payload :
string
- topic :
- Return type:
(uint32, error) - Slots:
bus_publish
Raw.BusPublishVetoable¶
| Go | |
|---|---|
BusPublishVetoable calls the bus_publish_vetoable slot.
As above, but collects the veto bit: returns true when any subscriber returned true. Every subscriber still runs β no short-circuit β so observers see a consistent stream whether or not an earlier one refused. out_delivered may be NULL.
- Parameters:
- topic :
string - payload :
string
- topic :
- Return type:
(uint32, bool, error) - Slots:
bus_publish_vetoable
Raw.BusSubscriberCount¶
| Go | |
|---|---|
BusSubscriberCount calls the bus_subscriber_count slot.
How many subscribers a topic has right now, across all mods. Intended for skipping the cost of building a payload nobody will read.
- Parameters:
- topic :
string
- topic :
- Return type:
(uint32, error) - Slots:
bus_subscriber_count
Raw.ServiceUnregister¶
| Go | |
|---|---|
ServiceUnregister calls the service_unregister slot.
Drop one of this mod's registrations. Scoped to the caller β a mod cannot unregister another mod's service.
- Parameters:
- regId :
uint64
- regId :
- Return type:
(bool, error) - Slots:
service_unregister
Raw.ServiceCall¶
| Go | |
|---|---|
ServiceCall calls the service_call slot.
Call name with request; the provider's answer arrives through reply. Returns one of PIER_SERVICE_*. A mod cannot call its own service (it has a direct function call, and self-calls are the least legible loop shape).
- Parameters:
- name :
string - request :
string
- name :
- Return type:
([]string, int32, error) - Slots:
service_call
Raw.ServiceList¶
| Go | |
|---|---|
ServiceList calls the service_list slot.
Every registered service as a JSON array of {"name":β¦,"mod":β¦}. For diagnostics and for a caller deciding whether to build a request nobody can answer.
- Return type:
([]string, error) - Slots:
service_list
Raw.LaneUnpublish¶
| Go | |
|---|---|
LaneUnpublish calls the lane_unpublish slot.
Withdraw a lane owned by this mod. Calls release for every outstanding lease and clears the liveness flag, so a consumer's next check sees the lane gone instead of jumping through a dead pointer.
- Parameters:
- pubId :
uint64
- pubId :
- Return type:
(bool, error) - Slots:
lane_unpublish
Raw.LaneRelease¶
| Go | |
|---|---|
LaneRelease calls the lane_release slot.
Return a lease. Only a lease held by this mod. Returns false when the provider is already gone, since the loader has called release for it by then and calling again would be a double free.
- Parameters:
- lease :
uint64
- lease :
- Return type:
(bool, error) - Slots:
lane_release
Raw.LaneList¶
| Go | |
|---|---|
LaneList calls the lane_list slot.
Every lane, as a JSON array: [{"name":β¦,"mod":β¦,"fingerprint":"0xβ¦","protocol":1,"leases":N,"alive":true}]
- Return type:
([]string, error) - Slots:
lane_list
Raw.ServiceCaller¶
| Go | |
|---|---|
ServiceCaller calls the service_caller slot.
Who is calling the service callback that is running right now.
- Return type:
([]string, error) - Slots:
service_caller
Registries¶
Raw.RegistryList¶
| Go | |
|---|---|
RegistryList calls the registry_list slot.
Lists one of the engine's registries through sink, one JSON object per entry, in no particular order. kind is a PIER_REGISTRY_* value.
- Parameters:
- kind :
int32
- kind :
- Return type:
([]string, bool, error) - Slots:
registry_list