Skip to content

Simulated players

Section notes in abi.h

Β§I NBT binary, KvDb (thread-safe), system & server info

Slots

sim_spawn

C
bool (*sim_spawn)(PierStr name, int32_t dimension, double x, double y, double z);

Group note

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.

  • Call: api->sim_spawn(name, dimension, x, y, z)
  • Parameters:
    • name : PierStr
    • dimension : int32_t
    • x : double
    • y : double
    • z : double
  • Return type: bool
  • Section of abi.h: Β§I NBT binary, KvDb (thread-safe), system & server info
  • Position in the table: slot 85, counting from 0
  • Callers in each binding:

sim_do

C
bool (*sim_do)(PierPlayerSel sel, PierStr action, PierStr args_snbt);

Group note

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.

sim_is

C
bool (*sim_is)(PierPlayerSel sel);

Group note

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.

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

sim_list

C
void (*sim_list)(void* ctx, PierStrSink name_sink);

Group note

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.

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.

  • Call: api->sim_list(ctx, name_sink)
  • Parameters:
    • ctx : void*
    • name_sink : PierStrSink
  • Section of abi.h: Β§I NBT binary, KvDb (thread-safe), system & server info
  • Position in the table: slot 88, counting from 0
  • Callers in each binding: