Bulk world editing¶
Section notes in abi.h
Bulk world editing, appended and struct_size-gated.
Native write paths that bypass the console-command route used by set_block (execute in <dim> run setblockβ¦). With these, block states come from structured NBT instead of command-string splicing, block entities can be written back, and entities can be respawned from saved NBT β all via existing engine entry points.
update_flags is a bitmask: 1 = notify neighbours, 2 = sync client, 3 = both (equivalent to /setblock), 0 = neither (fastest for bulk fills, but the caller must resync afterwards). Server thread only.
Appended: bulk block reads and writes
Slots¶
edit_set_block_nbt¶
| C | |
|---|---|
Write a block from serialized NBT ({name,states,version}, i.e. the shape get_block produces).
- Call:
api->edit_set_block_nbt(dim, x, y, z, snbt, update_flags) - Parameters:
- dim :
int32_t - x :
int32_t - y :
int32_t - z :
int32_t - snbt :
PierStr - update_flags :
int32_t
- dim :
- Return type:
bool - Section of abi.h: Bulk world editing, appended and struct_size-gated.
- Position in the table: slot 167, counting from 0
- Callers in each binding:
- Rust:
Block::set_nbt - Go:
Raw.EditSetBlockNbt
- Rust:
edit_set_block_states¶
| C | |
|---|---|
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.
- Call:
api->edit_set_block_states(dim, x, y, z, name, states_snbt, update_flags) - Parameters:
- dim :
int32_t - x :
int32_t - y :
int32_t - z :
int32_t - name :
PierStr - states_snbt :
PierStr - update_flags :
int32_t
- dim :
- Return type:
bool - Section of abi.h: Bulk world editing, appended and struct_size-gated.
- Position in the table: slot 168, counting from 0
- Callers in each binding:
- Rust:
Block::set_states - Go:
Raw.EditSetBlockStates
- Rust:
edit_set_block_entity¶
| C | |
|---|---|
Write a block entity's NBT back (BlockActor::load). The cell must already hold the matching block.
- Call:
api->edit_set_block_entity(dim, x, y, z, snbt) - Parameters:
- dim :
int32_t - x :
int32_t - y :
int32_t - z :
int32_t - snbt :
PierStr
- dim :
- Return type:
bool - Section of abi.h: Bulk world editing, appended and struct_size-gated.
- Position in the table: slot 169, counting from 0
- Callers in each binding:
edit_spawn_entity_nbt¶
| C | |
|---|---|
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.
- Call:
api->edit_spawn_entity_nbt(dim, snbt, use_pos, x, y, z, out) - Parameters:
- dim :
int32_t - snbt :
PierStr - use_pos :
bool - x :
double - y :
double - z :
double - out :
PierActorId*
- dim :
- Return type:
bool - Section of abi.h: Bulk world editing, appended and struct_size-gated.
- Position in the table: slot 170, counting from 0
- Callers in each binding:
edit_trace_ray¶
| C | |
|---|---|
Ray trace yielding the BLOCK coordinate and hit face: {type, block:[x,y,z], facing, pos:[x,y,z], entity}.
- Call:
api->edit_trace_ray(id, max_dist, include_actors, include_blocks, ctx, sink) - Parameters:
- id :
PierActorId - max_dist :
float - include_actors :
bool - include_blocks :
bool - ctx :
void* - sink :
PierStrSink
- id :
- Return type:
bool - Section of abi.h: Bulk world editing, appended and struct_size-gated.
- Position in the table: slot 171, counting from 0
- Callers in each binding:
- Rust:
Entity::trace_ray_blocks - Go:
Raw.EditTraceRay
- Rust:
edit_fill_region¶
| C | |
|---|---|
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.
- Call:
api->edit_fill_region(dimension, x1, y1, z1, x2, y2, z2, block_spec, update_flags) - Parameters:
- dimension :
int32_t - x1 :
int32_t - y1 :
int32_t - z1 :
int32_t - x2 :
int32_t - y2 :
int32_t - z2 :
int32_t - block_spec :
PierStr - update_flags :
int32_t
- dimension :
- Return type:
int64_t - Section of abi.h: Appended: bulk block reads and writes
- Position in the table: slot 190, counting from 0
- Callers in each binding:
- Rust:
World::fill_region - Go:
FillRegion,Raw.EditFillRegion
- Rust:
edit_set_blocks¶
| C | |
|---|---|
Writes many cells in one call. palette holds palette_count block specs, each resolved once; every cell names one by index. A cell whose index is out of range, or whose block did not resolve, is skipped and counted in the return value's complement. Returns the number of cells written, or -1 if the dimension is not ready or a pointer is null with a non-zero count. Server thread only.
- Call:
api->edit_set_blocks(dimension, palette, palette_count, cells, cell_count, update_flags) - Parameters:
- dimension :
int32_t - palette :
PierStr const* - palette_count :
uint32_t - cells :
PierBlockCell const* - cell_count :
size_t - update_flags :
int32_t
- dimension :
- Return type:
int64_t - Section of abi.h: Appended: bulk block reads and writes
- Position in the table: slot 191, counting from 0
- Callers in each binding:
- Rust:
World::set_blocks - Go:
SetBlocks
- Rust: