Actors
Section notes in abi.h
Β§C actors (players resolve here too, via player_resolve)
Actor: relationships, equipment, effects, geometry (dedicated fns)
Slots
list_actors
| C |
|---|
| void (*list_actors)(int32_t dim, void* ctx, PierActorSink sink);
|
Enumerate live actors; dim = -1 for all dimensions.
- Call:
api->list_actors(dim, ctx, sink)
- Parameters:
- dim :
int32_t
- ctx :
void*
- sink :
PierActorSink
- Section of abi.h: Β§C actors (players resolve here too, via player_resolve)
- Position in the table: slot 32, counting from 0
- Callers in each binding:
actor_snapshot
| C |
|---|
| bool (*actor_snapshot)(PierActorId id, void* ctx, PierStrSink snbt_sink);
|
Full Actor::save NBT as SNBT.
- Call:
api->actor_snapshot(id, ctx, snbt_sink)
- Parameters:
- id :
PierActorId
- ctx :
void*
- snbt_sink :
PierStrSink
- Return type:
bool
- Section of abi.h: Β§C actors (players resolve here too, via player_resolve)
- Position in the table: slot 33, counting from 0
- Callers in each binding:
actor_get_num
| C |
|---|
| bool (*actor_get_num)(PierActorId id, int32_t prop, double* out);
|
- Call:
api->actor_get_num(id, prop, out)
- Parameters:
- id :
PierActorId
- prop :
int32_t
- out :
double*
- Return type:
bool
- Section of abi.h: Β§C actors (players resolve here too, via player_resolve)
- Position in the table: slot 34, counting from 0
- Callers in each binding:
- Rust:
Entity::num, Entity::pos, Entity::feet_pos, Entity::head_pos, Entity::velocity, Entity::view_vector and more, 37 in all
- Go:
Entity.PosX, Entity.PosY, Entity.PosZ, Entity.RotPitch, Entity.RotYaw, Entity.Dimension and more, 49 in all
- Zig:
Entity.posX, Entity.posY, Entity.posZ, Entity.rotPitch, Entity.rotYaw, Entity.dimension and more, 48 in all
actor_get_str
| C |
|---|
| bool (*actor_get_str)(PierActorId id, int32_t prop, void* ctx, PierStrSink sink);
|
- Call:
api->actor_get_str(id, prop, ctx, sink)
- Parameters:
- id :
PierActorId
- prop :
int32_t
- ctx :
void*
- sink :
PierStrSink
- Return type:
bool
- Section of abi.h: Β§C actors (players resolve here too, via player_resolve)
- Position in the table: slot 35, counting from 0
- Callers in each binding:
- Rust:
Entity::exists, Entity::text, Entity::type_name, Entity::name_tag, Entity::score_tag, Entity::filtered_name
- Go:
Entity.TypeName, Entity.NameTag, Entity.ScoreTag, Entity.FilteredName, Raw.ActorGetStr
- Zig:
Entity.typeName, Entity.nameTag, Entity.scoreTag, Entity.filteredName
actor_action
| C |
|---|
| bool (*actor_action)(
PierActorId id,
int32_t action,
PierStr sarg,
double a,
double b,
double c,
void* ctx,
PierStrSink out
);
|
- Call:
api->actor_action(id, action, sarg, a, b, c, ctx, out)
- Parameters:
- id :
PierActorId
- action :
int32_t
- sarg :
PierStr
- a :
double
- b :
double
- c :
double
- ctx :
void*
- out :
PierStrSink
- Return type:
bool
- Section of abi.h: Β§C actors (players resolve here too, via player_resolve)
- Position in the table: slot 36, counting from 0
- Callers in each binding:
- Rust:
Entity::act, Entity::kill, Entity::despawn, Entity::clear_effects, Entity::stop_fire, Entity::remove_all_passengers and more, 35 in all
- Go:
Entity.Kill, Entity.Despawn, Entity.Heal, Entity.SetOnFire, Entity.Teleport, Entity.SetNameTag and more, 34 in all
- Zig:
Entity.kill, Entity.despawn, Entity.heal, Entity.setOnFire, Entity.teleport, Entity.setNameTag and more, 33 in all
spawn_mob
| C |
|---|
| bool (*spawn_mob)(int32_t dim, PierStr type_name, double x, double y, double z, PierActorId* out);
|
Spawn a mob (Spawner::spawnMob); on success *out = its ActorUniqueID.
- Call:
api->spawn_mob(dim, type_name, x, y, z, out)
- Parameters:
- dim :
int32_t
- type_name :
PierStr
- x :
double
- y :
double
- z :
double
- out :
PierActorId*
- Return type:
bool
- Section of abi.h: Β§C actors (players resolve here too, via player_resolve)
- Position in the table: slot 37, counting from 0
- Callers in each binding:
actor_get_vehicle
| C |
|---|
| bool (*actor_get_vehicle)(PierActorId id, PierActorId* out);
|
- Call:
api->actor_get_vehicle(id, out)
- Parameters:
- id :
PierActorId
- out :
PierActorId*
- Return type:
bool
- Section of abi.h: Actor: relationships, equipment, effects, geometry (dedicated fns)
- Position in the table: slot 109, counting from 0
- Callers in each binding:
actor_get_first_passenger
| C |
|---|
| bool (*actor_get_first_passenger)(PierActorId id, PierActorId* out);
|
- Call:
api->actor_get_first_passenger(id, out)
- Parameters:
- id :
PierActorId
- out :
PierActorId*
- Return type:
bool
- Section of abi.h: Actor: relationships, equipment, effects, geometry (dedicated fns)
- Position in the table: slot 110, counting from 0
- Callers in each binding:
actor_get_owner
| C |
|---|
| bool (*actor_get_owner)(PierActorId id, PierActorId* out);
|
- Call:
api->actor_get_owner(id, out)
- Parameters:
- id :
PierActorId
- out :
PierActorId*
- Return type:
bool
- Section of abi.h: Actor: relationships, equipment, effects, geometry (dedicated fns)
- Position in the table: slot 111, counting from 0
- Callers in each binding:
actor_get_target
| C |
|---|
| bool (*actor_get_target)(PierActorId id, PierActorId* out);
|
- Call:
api->actor_get_target(id, out)
- Parameters:
- id :
PierActorId
- out :
PierActorId*
- Return type:
bool
- Section of abi.h: Actor: relationships, equipment, effects, geometry (dedicated fns)
- Position in the table: slot 112, counting from 0
- Callers in each binding:
actor_get_equipped_item
| C |
|---|
| bool (*actor_get_equipped_item)(PierActorId id, int32_t slot, void* ctx, PierStrSink sink);
|
slot: 0=mainhand 1=offhand 2=helmet 3=chestplate 4=leggings 5=boots
- Call:
api->actor_get_equipped_item(id, slot, ctx, sink)
- Parameters:
- id :
PierActorId
- slot :
int32_t
- ctx :
void*
- sink :
PierStrSink
- Return type:
bool
- Section of abi.h: Actor: relationships, equipment, effects, geometry (dedicated fns)
- Position in the table: slot 113, counting from 0
- Callers in each binding:
actor_set_equipped_item
| C |
|---|
| bool (*actor_set_equipped_item)(PierActorId id, int32_t slot, PierStr item_snbt);
|
- Call:
api->actor_set_equipped_item(id, slot, item_snbt)
- Parameters:
- id :
PierActorId
- slot :
int32_t
- item_snbt :
PierStr
- Return type:
bool
- Section of abi.h: Actor: relationships, equipment, effects, geometry (dedicated fns)
- Position in the table: slot 114, counting from 0
- Callers in each binding:
actor_get_effects
| C |
|---|
| bool (*actor_get_effects)(PierActorId id, void* ctx, PierStrSink sink);
|
SNBT [{id, ticks, amplifier, visible},β¦]
- Call:
api->actor_get_effects(id, ctx, sink)
- Parameters:
- id :
PierActorId
- ctx :
void*
- sink :
PierStrSink
- Return type:
bool
- Section of abi.h: Actor: relationships, equipment, effects, geometry (dedicated fns)
- Position in the table: slot 115, counting from 0
- Callers in each binding:
actor_get_status_flag
| C |
|---|
| bool (*actor_get_status_flag)(PierActorId id, int32_t flag_index);
|
flag_index: ActorFlags enum value (0-based).
- Call:
api->actor_get_status_flag(id, flag_index)
- Parameters:
- id :
PierActorId
- flag_index :
int32_t
- Return type:
bool
- Section of abi.h: Actor: relationships, equipment, effects, geometry (dedicated fns)
- Position in the table: slot 116, counting from 0
- Callers in each binding:
actor_set_status_flag
| C |
|---|
| bool (*actor_set_status_flag)(PierActorId id, int32_t flag_index, bool value);
|
- Call:
api->actor_set_status_flag(id, flag_index, value)
- Parameters:
- id :
PierActorId
- flag_index :
int32_t
- value :
bool
- Return type:
bool
- Section of abi.h: Actor: relationships, equipment, effects, geometry (dedicated fns)
- Position in the table: slot 117, counting from 0
- Callers in each binding:
actor_trace_ray
| C |
|---|
| bool (*actor_trace_ray)(PierActorId id, float max_dist, bool include_actors, bool include_blocks, void* ctx,
PierStrSink sink);
|
SNBT {type:"entity"|"block"|"none", pos:[x,y,z], entity_id?, block_name?}
- Call:
api->actor_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
- Return type:
bool
- Section of abi.h: Actor: relationships, equipment, effects, geometry (dedicated fns)
- Position in the table: slot 118, counting from 0
- Callers in each binding:
actor_distance_to
| C |
|---|
| bool (*actor_distance_to)(PierActorId id, PierActorId other, double* out);
|
- Call:
api->actor_distance_to(id, other, out)
- Parameters:
- id :
PierActorId
- other :
PierActorId
- out :
double*
- Return type:
bool
- Section of abi.h: Actor: relationships, equipment, effects, geometry (dedicated fns)
- Position in the table: slot 119, counting from 0
- Callers in each binding:
actor_get_aabb
| C |
|---|
| bool (*actor_get_aabb)(PierActorId id, void* ctx, PierStrSink sink);
|
SNBT {min:[x,y,z], max:[x,y,z]}
- Call:
api->actor_get_aabb(id, ctx, sink)
- Parameters:
- id :
PierActorId
- ctx :
void*
- sink :
PierStrSink
- Return type:
bool
- Section of abi.h: Actor: relationships, equipment, effects, geometry (dedicated fns)
- Position in the table: slot 120, counting from 0
- Callers in each binding:
actor_clone
| C |
|---|
| bool (*actor_clone)(PierActorId id, int32_t dim, double x, double y, double z, PierActorId* out);
|
- Call:
api->actor_clone(id, dim, x, y, z, out)
- Parameters:
- id :
PierActorId
- dim :
int32_t
- x :
double
- y :
double
- z :
double
- out :
PierActorId*
- Return type:
bool
- Section of abi.h: Actor: relationships, equipment, effects, geometry (dedicated fns)
- Position in the table: slot 121, counting from 0
- Callers in each binding:
PierActorNumProp
actor_get_num / actor_set_num keys. (S)=settable via actor_set_num.
| Name |
Value |
Description |
PIER_APROP_POS_X |
0 |
(G) Actor::getPosition().x (feet: getFeetPos for players; POS_* uses getPosition) |
PIER_APROP_POS_Y |
1 |
(G) |
PIER_APROP_POS_Z |
2 |
(G) |
PIER_APROP_ROT_PITCH |
3 |
(G) Actor::getRotation().x |
PIER_APROP_ROT_YAW |
4 |
(G) Actor::getRotation().y |
PIER_APROP_DIMENSION |
5 |
(G) Actor::getDimensionId |
PIER_APROP_HEALTH |
6 |
(G) Actor::getHealth; heal/hurt via actions |
PIER_APROP_MAX_HEALTH |
7 |
(G) Actor::getMaxHealth |
PIER_APROP_IS_ALIVE |
8 |
(G) Actor::isAlive |
PIER_APROP_IS_ON_GROUND |
9 |
(G) Actor::isOnGround |
PIER_APROP_IS_IN_WATER |
10 |
(G) Actor::isInWater |
PIER_APROP_IS_IN_LAVA |
11 |
(G) Actor::isInLava |
PIER_APROP_IS_ON_FIRE |
12 |
(G) Actor::isOnFire |
PIER_APROP_IS_INVISIBLE |
13 |
(G) Actor::isInvisible |
PIER_APROP_IS_SNEAKING |
14 |
(G) Actor::isSneaking |
PIER_APROP_IS_BABY |
15 |
(G) Actor::isBaby |
PIER_APROP_IS_RIDING |
16 |
(G) Actor::isRiding |
PIER_APROP_IS_TAME |
17 |
(G) Actor::isTame |
PIER_APROP_SPEED |
18 |
(G) Actor::getSpeedInMetersPerSecond |
PIER_APROP_VIEW_X |
19 |
(G) Actor::getViewVector().x |
PIER_APROP_VIEW_Y |
20 |
(G) Actor::getViewVector().y |
PIER_APROP_VIEW_Z |
21 |
(G) Actor::getViewVector().z |
PIER_APROP_VEL_X |
22 |
(G) Actor::getVelocity().x |
PIER_APROP_VEL_Y |
23 |
(G) Actor::getVelocity().y |
PIER_APROP_VEL_Z |
24 |
(G) Actor::getVelocity().z |
PIER_APROP_HEAD_X |
25 |
(G) Actor::getHeadPos().x |
PIER_APROP_HEAD_Y |
26 |
(G) Actor::getHeadPos().y |
PIER_APROP_HEAD_Z |
27 |
(G) Actor::getHeadPos().z |
PIER_APROP_FEET_X |
28 |
(G) Actor::getFeetPos().x |
PIER_APROP_FEET_Y |
29 |
(G) Actor::getFeetPos().y |
PIER_APROP_FEET_Z |
30 |
(G) Actor::getFeetPos().z |
PIER_APROP_FALL_DISTANCE |
31 |
(G) Actor::getFallDistance |
PIER_APROP_IS_PERSISTENT |
32 |
(G) Actor::isPersistent |
PIER_APROP_IS_LEASHED |
33 |
(G) Actor::isLeashed |
PIER_APROP_IS_INVULNERABLE |
34 |
(G) Actor::isInvulnerable |
PIER_APROP_VARIANT |
35 |
(G) Actor::getVariant |
PIER_APROP_MARK_VARIANT |
36 |
(G) Actor::getMarkVariant |
PIER_APROP_SCALE |
37 |
(G) Actor::getScaleFactor |
PIER_APROP_BRIGHTNESS |
38 |
(G) Actor::getBrightness |
PIER_APROP_RADIUS |
39 |
(G) Actor::getRadius |
PIER_APROP_HAS_TOTEM |
40 |
(G) Actor::hasTotemEquipped |
PIER_APROP_IS_IN_RAIN |
41 |
(G) Actor::isInRain |
PIER_APROP_IS_IN_SNOW |
42 |
(G) Actor::isInSnow |
PIER_APROP_IS_IN_THUNDERSTORM |
43 |
(G) Actor::isInThunderstorm |
PIER_APROP_IS_FROZEN |
44 |
(G) Actor::isFrozen |
PIER_APROP_IS_IN_LOVE |
45 |
the current engine version gives no value for this constant: (G) unsupported since BDS 1.26.40: Actor::isInLove is gone |
PIER_APROP_DEATH_TIME |
46 |
(G) Actor::getDeathTime |
PIER_APROP_HAS_PASSENGER |
47 |
(G) Actor::hasPassenger |
PierActorStrProp
actor_get_str keys.
| Name |
Value |
Description |
PIER_ASTR_TYPE_NAME |
0 |
Actor::getTypeName |
PIER_ASTR_NAME_TAG |
1 |
Actor::getNameTag |
PIER_ASTR_SCORE_TAG |
2 |
Actor::getScoreTag |
PIER_ASTR_FILTERED_NAME |
3 |
Actor::getFilteredNameTag |
PierActorAction
actor_action verbs. Args (sarg, a, b, c); out receives a result where noted.
| Name |
Value |
Description |
PIER_AACT_KILL |
0 |
Actor::kill |
PIER_AACT_DESPAWN |
1 |
Actor::despawn |
PIER_AACT_HEAL |
2 |
a=amount Actor::heal |
PIER_AACT_SET_ON_FIRE |
3 |
a=seconds Actor::setOnFire |
PIER_AACT_TELEPORT |
4 |
a,b,c=pos, sarg=dim ("0".."2") Actor::teleport |
PIER_AACT_SET_NAME_TAG |
5 |
sarg=name Actor::setNameTag |
PIER_AACT_ADD_TAG |
6 |
sarg=tag β out "0"/"1" Actor::addTag |
PIER_AACT_REMOVE_TAG |
7 |
sarg=tag β out "0"/"1" Actor::removeTag |
PIER_AACT_HAS_TAG |
8 |
sarg=tag β out "0"/"1" Actor::hasTag |
PIER_AACT_ADD_EFFECT |
9 |
sarg=effect name, a=ticks, b=amplifier, c=visible(0/1) MobEffect::getByName + Actor::addEffect |
PIER_AACT_REMOVE_EFFECT |
10 |
sarg=effect name Actor::removeEffect(id) |
PIER_AACT_CLEAR_EFFECTS |
11 |
Actor::removeAllEffects |
PIER_AACT_HURT |
12 |
a=damage (generic damage source) Actor::hurt |
PIER_AACT_ATTRIBUTE_GET |
13 |
sarg=attribute name ("minecraft:health"β¦) β out value |
PIER_AACT_SET_VARIANT |
14 |
a=variant Actor::setVariant |
PIER_AACT_SET_MARK_VARIANT |
15 |
a=variant Actor::setMarkVariant |
PIER_AACT_SET_PERSISTENT |
16 |
Actor::setPersistent |
PIER_AACT_SET_LEASH_HOLDER |
17 |
a=holder ActorUniqueID Actor::setLeashHolder |
PIER_AACT_SET_INVISIBLE |
18 |
a=0/1 Actor::setInvisible |
PIER_AACT_SET_SNEAKING |
19 |
a=0/1 Actor::setSneaking |
PIER_AACT_SET_NAME_TAG_VISIBLE |
20 |
a=0/1 Actor::setNameTagVisible |
PIER_AACT_SET_TARGET |
21 |
a=target ActorUniqueID Actor::setTarget |
PIER_AACT_SET_OWNER |
22 |
a=owner ActorUniqueID Actor::setOwner |
PIER_AACT_BURN |
23 |
a=damage Actor::burn |
PIER_AACT_STOP_FIRE |
24 |
Actor::extinguishFire |
PIER_AACT_SET_VELOCITY |
25 |
a,b,c=vel Actor::setVelocity |
PIER_AACT_APPLY_IMPULSE |
26 |
a,b,c=impulse Actor::applyImpulse |
PIER_AACT_SET_SCORE_TAG |
27 |
sarg=text Actor::setScoreTag |
PIER_AACT_SET_SKIN_ID |
28 |
a=skin id Actor::setSkinID |
PIER_AACT_SET_STRENGTH |
29 |
a=strength Actor::setStrength |
PIER_AACT_REMOVE_ALL_PASSENGERS |
30 |
Actor::removeAllPassengers |
PIER_AACT_EXECUTE_EVENT |
31 |
sarg=event name Actor::executeEvent |
PIER_AACT_SET_ROTATION |
32 |
a=pitch b=yaw Actor::setRotationWrapped |