Zig:实体¶
Entity¶
一个实体,由它的唯一 id 指定,也就是事件载荷里的 uid。
Entity.of¶
| Zig | |
|---|---|
- 参数:
- actor_id_value :
i64
- actor_id_value :
- 返回值类型:
Entity
Entity.posX¶
| Zig | |
|---|---|
PIER_APROP_POS_X:(G) Actor::getPosition().x(玩家的脚下位置要用 getFeetPos;POS_* 用的是 getPosition)
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.posY¶
| Zig | |
|---|---|
PIER_APROP_POS_Y:(G)
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.posZ¶
| Zig | |
|---|---|
PIER_APROP_POS_Z:(G)
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.rotPitch¶
| Zig | |
|---|---|
PIER_APROP_ROT_PITCH:(G) Actor::getRotation().x
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.rotYaw¶
| Zig | |
|---|---|
PIER_APROP_ROT_YAW:(G) Actor::getRotation().y
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.dimension¶
| Zig | |
|---|---|
PIER_APROP_DIMENSION:(G) Actor::getDimensionId
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.health¶
| Zig | |
|---|---|
PIER_APROP_HEALTH:(G) Actor::getHealth;治疗和伤害用动作完成
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.maxHealth¶
| Zig | |
|---|---|
PIER_APROP_MAX_HEALTH:(G) Actor::getMaxHealth
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.isAlive¶
| Zig | |
|---|---|
PIER_APROP_IS_ALIVE:(G) Actor::isAlive
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.isOnGround¶
| Zig | |
|---|---|
PIER_APROP_IS_ON_GROUND:(G) Actor::isOnGround
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.isInWater¶
| Zig | |
|---|---|
PIER_APROP_IS_IN_WATER:(G) Actor::isInWater
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.isInLava¶
| Zig | |
|---|---|
PIER_APROP_IS_IN_LAVA:(G) Actor::isInLava
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.isOnFire¶
| Zig | |
|---|---|
PIER_APROP_IS_ON_FIRE:(G) Actor::isOnFire
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.isInvisible¶
| Zig | |
|---|---|
PIER_APROP_IS_INVISIBLE:(G) Actor::isInvisible
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.isSneaking¶
| Zig | |
|---|---|
PIER_APROP_IS_SNEAKING:(G) Actor::isSneaking
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.isBaby¶
| Zig | |
|---|---|
PIER_APROP_IS_BABY:(G) Actor::isBaby
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.isRiding¶
| Zig | |
|---|---|
PIER_APROP_IS_RIDING:(G) Actor::isRiding
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.isTame¶
| Zig | |
|---|---|
PIER_APROP_IS_TAME:(G) Actor::isTame
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.speed¶
| Zig | |
|---|---|
PIER_APROP_SPEED:(G) Actor::getSpeedInMetersPerSecond
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.viewX¶
| Zig | |
|---|---|
PIER_APROP_VIEW_X:(G) Actor::getViewVector().x
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.viewY¶
| Zig | |
|---|---|
PIER_APROP_VIEW_Y:(G) Actor::getViewVector().y
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.viewZ¶
| Zig | |
|---|---|
PIER_APROP_VIEW_Z:(G) Actor::getViewVector().z
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.velX¶
| Zig | |
|---|---|
PIER_APROP_VEL_X:(G) Actor::getVelocity().x
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.velY¶
| Zig | |
|---|---|
PIER_APROP_VEL_Y:(G) Actor::getVelocity().y
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.velZ¶
| Zig | |
|---|---|
PIER_APROP_VEL_Z:(G) Actor::getVelocity().z
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.headX¶
| Zig | |
|---|---|
PIER_APROP_HEAD_X:(G) Actor::getHeadPos().x
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.headY¶
| Zig | |
|---|---|
PIER_APROP_HEAD_Y:(G) Actor::getHeadPos().y
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.headZ¶
| Zig | |
|---|---|
PIER_APROP_HEAD_Z:(G) Actor::getHeadPos().z
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.feetX¶
| Zig | |
|---|---|
PIER_APROP_FEET_X:(G) Actor::getFeetPos().x
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.feetY¶
| Zig | |
|---|---|
PIER_APROP_FEET_Y:(G) Actor::getFeetPos().y
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.feetZ¶
| Zig | |
|---|---|
PIER_APROP_FEET_Z:(G) Actor::getFeetPos().z
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.fallDistance¶
| Zig | |
|---|---|
PIER_APROP_FALL_DISTANCE:(G) Actor::getFallDistance
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.isPersistent¶
| Zig | |
|---|---|
PIER_APROP_IS_PERSISTENT:(G) Actor::isPersistent
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.isLeashed¶
| Zig | |
|---|---|
PIER_APROP_IS_LEASHED:(G) Actor::isLeashed
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.isInvulnerable¶
| Zig | |
|---|---|
PIER_APROP_IS_INVULNERABLE:(G) Actor::isInvulnerable
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.variant¶
| Zig | |
|---|---|
PIER_APROP_VARIANT:(G) Actor::getVariant
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.markVariant¶
| Zig | |
|---|---|
PIER_APROP_MARK_VARIANT:(G) Actor::getMarkVariant
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.scale¶
| Zig | |
|---|---|
PIER_APROP_SCALE:(G) Actor::getScaleFactor
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.brightness¶
| Zig | |
|---|---|
PIER_APROP_BRIGHTNESS:(G) Actor::getBrightness
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.radius¶
| Zig | |
|---|---|
PIER_APROP_RADIUS:(G) Actor::getRadius
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.hasTotem¶
| Zig | |
|---|---|
PIER_APROP_HAS_TOTEM:(G) Actor::hasTotemEquipped
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.isInRain¶
| Zig | |
|---|---|
PIER_APROP_IS_IN_RAIN:(G) Actor::isInRain
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.isInSnow¶
| Zig | |
|---|---|
PIER_APROP_IS_IN_SNOW:(G) Actor::isInSnow
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.isInThunderstorm¶
| Zig | |
|---|---|
PIER_APROP_IS_IN_THUNDERSTORM:(G) Actor::isInThunderstorm
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.isFrozen¶
| Zig | |
|---|---|
PIER_APROP_IS_FROZEN:(G) Actor::isFrozen
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.isInLove¶
| Zig | |
|---|---|
PIER_APROP_IS_IN_LOVE:(G) 从 BDS 1.26.40 起不再支持:Actor::isInLove 已被移除
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.deathTime¶
| Zig | |
|---|---|
PIER_APROP_DEATH_TIME:(G) Actor::getDeathTime
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.hasPassenger¶
| Zig | |
|---|---|
PIER_APROP_HAS_PASSENGER:(G) Actor::hasPassenger
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.isSprinting¶
| Zig | |
|---|---|
PIER_APROP_IS_SPRINTING:Actor::isSprinting
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.isSwimming¶
| Zig | |
|---|---|
PIER_APROP_IS_SWIMMING:Actor::isSwimming
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.isSleeping¶
| Zig | |
|---|---|
PIER_APROP_IS_SLEEPING:Actor::isSleeping
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.isSitting¶
| Zig | |
|---|---|
PIER_APROP_IS_SITTING:Actor::isSitting
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.isAngry¶
| Zig | |
|---|---|
PIER_APROP_IS_ANGRY:Actor::isAngry
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.strength¶
| Zig | |
|---|---|
PIER_APROP_STRENGTH:Actor::getStrength
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.isPlayer¶
| Zig | |
|---|---|
PIER_APROP_IS_PLAYER:Actor::isPlayer
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.isSimulatedPlayer¶
| Zig | |
|---|---|
PIER_APROP_IS_SIMULATED_PLAYER:Actor::isSimulatedPlayer
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.entityType¶
| Zig | |
|---|---|
PIER_APROP_ENTITY_TYPE:Actor::getEntityTypeId,含义与 registry_list 实体条目中的类型位相同
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_get_num
Entity.canFly¶
| Zig | |
|---|---|
PIER_APROP_CAN_FLY:Actor::canFly
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_num
Entity.typeName¶
| Zig | |
|---|---|
PIER_ASTR_TYPE_NAME:取自 Actor::getTypeName
- 参数:
- allocator :
std.mem.Allocator
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_get_str
Entity.nameTag¶
| Zig | |
|---|---|
PIER_ASTR_NAME_TAG:取自 Actor::getNameTag
- 参数:
- allocator :
std.mem.Allocator
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_get_str
Entity.scoreTag¶
| Zig | |
|---|---|
PIER_ASTR_SCORE_TAG:取自 Actor::getScoreTag
- 参数:
- allocator :
std.mem.Allocator
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_get_str
Entity.filteredName¶
| Zig | |
|---|---|
PIER_ASTR_FILTERED_NAME:取自 Actor::getFilteredNameTag
- 参数:
- allocator :
std.mem.Allocator
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_get_str
Entity.tags¶
| Zig | |
|---|---|
PIER_ASTR_TAGS:Actor::getTags,字符串组成的 JSON 数组
- 参数:
- allocator :
std.mem.Allocator
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_get_str
Entity.ownerId¶
| Zig | |
|---|---|
PIER_ASTR_OWNER_ID:Actor::getOwnerId,十进制的实体 id,没有主人时为 -1
- 参数:
- allocator :
std.mem.Allocator
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_get_str
Entity.kill¶
| Zig | |
|---|---|
PIER_AACT_KILL:调用 Actor::kill
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.despawn¶
| Zig | |
|---|---|
PIER_AACT_DESPAWN:调用 Actor::despawn
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.heal¶
| Zig | |
|---|---|
PIER_AACT_HEAL:a 为治疗量,调用 Actor::heal
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.setOnFire¶
| Zig | |
|---|---|
PIER_AACT_SET_ON_FIRE:a 为秒数,调用 Actor::setOnFire
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.teleport¶
| Zig | |
|---|---|
PIER_AACT_TELEPORT:a、b、c 为坐标,sarg 为维度("0" 到 "2"),调用 Actor::teleport
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.setNameTag¶
| Zig | |
|---|---|
PIER_AACT_SET_NAME_TAG:sarg 为名字,调用 Actor::setNameTag
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.addTag¶
| Zig | |
|---|---|
PIER_AACT_ADD_TAG:sarg 为标签,输出 "0" 或 "1",调用 Actor::addTag
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.removeTag¶
| Zig | |
|---|---|
PIER_AACT_REMOVE_TAG:sarg 为标签,输出 "0" 或 "1",调用 Actor::removeTag
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.hasTag¶
| Zig | |
|---|---|
PIER_AACT_HAS_TAG:sarg 为标签,输出 "0" 或 "1",调用 Actor::hasTag
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.addEffect¶
| Zig | |
|---|---|
PIER_AACT_ADD_EFFECT:sarg 为效果名,a 为刻数,b 为效果等级,c 为是否显示粒子(0 或 1),经 MobEffect::getByName 和 Actor::addEffect 完成
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.removeEffect¶
| Zig | |
|---|---|
PIER_AACT_REMOVE_EFFECT:sarg 为效果名,调用 Actor::removeEffect(id)
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.clearEffects¶
| Zig | |
|---|---|
PIER_AACT_CLEAR_EFFECTS:调用 Actor::removeAllEffects
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.hurt¶
| Zig | |
|---|---|
PIER_AACT_HURT:a 为伤害值(通用伤害来源),调用 Actor::hurt
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.attributeGet¶
| Zig | |
|---|---|
PIER_AACT_ATTRIBUTE_GET:sarg 为属性名("minecraft:health" 等),输出属性值
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.setVariant¶
| Zig | |
|---|---|
PIER_AACT_SET_VARIANT:a 为变种值,调用 Actor::setVariant
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.setMarkVariant¶
| Zig | |
|---|---|
PIER_AACT_SET_MARK_VARIANT:a 为变种值,调用 Actor::setMarkVariant
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.setPersistent¶
| Zig | |
|---|---|
PIER_AACT_SET_PERSISTENT:调用 Actor::setPersistent
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.setLeashHolder¶
| Zig | |
|---|---|
PIER_AACT_SET_LEASH_HOLDER:a 为牵引者的 ActorUniqueID,调用 Actor::setLeashHolder
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.setInvisible¶
| Zig | |
|---|---|
PIER_AACT_SET_INVISIBLE:a 为 0 或 1,调用 Actor::setInvisible
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.setSneaking¶
| Zig | |
|---|---|
PIER_AACT_SET_SNEAKING:a 为 0 或 1,调用 Actor::setSneaking
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.setNameTagVisible¶
| Zig | |
|---|---|
PIER_AACT_SET_NAME_TAG_VISIBLE:a 为 0 或 1,调用 Actor::setNameTagVisible
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.setTarget¶
| Zig | |
|---|---|
PIER_AACT_SET_TARGET:a 为目标的 ActorUniqueID,调用 Actor::setTarget
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.setOwner¶
| Zig | |
|---|---|
PIER_AACT_SET_OWNER:a 为主人的 ActorUniqueID,调用 Actor::setOwner
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.burn¶
| Zig | |
|---|---|
PIER_AACT_BURN:a 为伤害值,调用 Actor::burn
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.stopFire¶
| Zig | |
|---|---|
PIER_AACT_STOP_FIRE:调用 Actor::extinguishFire
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.setVelocity¶
| Zig | |
|---|---|
PIER_AACT_SET_VELOCITY:a、b、c 为速度,调用 Actor::setVelocity
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.applyImpulse¶
| Zig | |
|---|---|
PIER_AACT_APPLY_IMPULSE:a、b、c 为冲量,调用 Actor::applyImpulse
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.setScoreTag¶
| Zig | |
|---|---|
PIER_AACT_SET_SCORE_TAG:sarg 为文本,调用 Actor::setScoreTag
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.setSkinId¶
| Zig | |
|---|---|
PIER_AACT_SET_SKIN_ID:a 为皮肤 id,调用 Actor::setSkinID
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.setStrength¶
| Zig | |
|---|---|
PIER_AACT_SET_STRENGTH:a 为强度,调用 Actor::setStrength
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.removeAllPassengers¶
| Zig | |
|---|---|
PIER_AACT_REMOVE_ALL_PASSENGERS:调用 Actor::removeAllPassengers
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.executeEvent¶
| Zig | |
|---|---|
PIER_AACT_EXECUTE_EVENT:sarg 为事件名,调用 Actor::executeEvent
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.setRotation¶
| Zig | |
|---|---|
PIER_AACT_SET_ROTATION:a 为俯仰角,b 为偏航角,调用 Actor::setRotationWrapped
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.setSitting¶
| Zig | |
|---|---|
PIER_AACT_SET_SITTING:a:非零时坐下。Actor::setSitting
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.startRiding¶
| Zig | |
|---|---|
PIER_AACT_START_RIDING:sarg:载具的十进制实体 id,a:非零时强制。Actor::startRiding
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.attributeSet¶
| Zig | |
|---|---|
PIER_AACT_ATTRIBUTE_SET:sarg:属性名,a:值。BaseAttributeMap::setCurrentValue
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.attributeSetMax¶
| Zig | |
|---|---|
PIER_AACT_ATTRIBUTE_SET_MAX:sarg:属性名,a:最大值。BaseAttributeMap::setMaxValue
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.attributeSetDefault¶
| Zig | |
|---|---|
PIER_AACT_ATTRIBUTE_SET_DEFAULT:sarg:属性名,a:默认值。BaseAttributeMap::setDefaultValue
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.attributeList¶
| Zig | |
|---|---|
PIER_AACT_ATTRIBUTE_LIST:out:这个实体拥有的属性名组成的 JSON 数组,限于属性动作认识的那些
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.attributeInfo¶
| Zig | |
|---|---|
PIER_AACT_ATTRIBUTE_INFO:sarg:属性名;out:JSON {current, min, max, default}
这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。
- 参数:
- allocator :
std.mem.Allocator - s_arg :
[]const u8 - n_a :
f64 - n_b :
f64 - n_c :
f64
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_action
Entity.snapshot¶
| Zig | |
|---|---|
整个实体的 SNBT,由调用方持有。
- 参数:
- allocator :
std.mem.Allocator
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_snapshot
Entity.cloneAt¶
| Zig | |
|---|---|
把这个实体克隆到一个给定的位置。
- 参数:
- dim :
i32 - x :
f64 - y :
f64 - z :
f64
- dim :
- 返回值类型:
core.Error!Entity - 对应槽位:
actor_clone
Entity.distanceTo¶
| Zig | |
|---|---|
两个实体之间的距离。跨维度时宿主会拒绝。
- 参数:
- other :
Entity
- other :
- 返回值类型:
core.Error!f64 - 对应槽位:
actor_distance_to
Entity.aabb¶
| Zig | |
|---|---|
碰撞箱。
- 参数:
- allocator :
std.mem.Allocator
- allocator :
- 返回值类型:
core.Error!types.Aabb - 对应槽位:
actor_get_aabb
Entity.effects¶
| Zig | |
|---|---|
这个实体身上的每一个状态效果。
- 参数:
- allocator :
std.mem.Allocator
- allocator :
- 返回值类型:
core.Error!types.Owned(types.Effect) - 对应槽位:
actor_get_effects
Entity.equippedItem¶
| Zig | |
|---|---|
一个槽位里装备的东西,物品 SNBT 形式,由调用方持有。
- 参数:
- allocator :
std.mem.Allocator - slot :
types.EquipSlot
- allocator :
- 返回值类型:
core.Error![]u8 - 对应槽位:
actor_get_equipped_item
Entity.setEquippedItem¶
| Zig | |
|---|---|
- 参数:
- slot :
types.EquipSlot - item_snbt :
[]const u8
- slot :
- 返回值类型:
core.Error!void - 对应槽位:
actor_set_equipped_item
Entity.vehicle¶
| Zig | |
|---|---|
正在骑乘的载具。没有骑乘任何东西时为 null,只有槽位缺失才是错误。
- 返回值类型:
core.Error!?Entity
Entity.firstPassenger¶
| Zig | |
|---|---|
- 返回值类型:
core.Error!?Entity
Entity.owner¶
| Zig | |
|---|---|
- 返回值类型:
core.Error!?Entity
Entity.target¶
| Zig | |
|---|---|
- 返回值类型:
core.Error!?Entity
Entity.statusFlag¶
| Zig | |
|---|---|
读取 ActorFlags 的一位。
- 参数:
- flag_index :
i32
- flag_index :
- 返回值类型:
core.Error!bool - 对应槽位:
actor_get_status_flag
Entity.setStatusFlag¶
| Zig | |
|---|---|
- 参数:
- flag_index :
i32 - value :
bool
- flag_index :
- 返回值类型:
core.Error!void - 对应槽位:
actor_set_status_flag
Entity.traceRay¶
| Zig | |
|---|---|
沿着这个实体的视线射出一条射线,报告它撞到了什么。撞到方块时,名字由 allocator 持有,用 RayHit.deinit 释放。
- 参数:
- allocator :
std.mem.Allocator - max_dist :
f32 - include_actors :
bool - include_blocks :
bool
- allocator :
- 返回值类型:
core.Error!types.RayHit - 对应槽位:
actor_trace_ray
Entity.traceRayBlocks¶
| Zig | |
|---|---|
同 traceRay,但把命中结果报告为一个方块格子,并带上被击中的那一面。
- 参数:
- allocator :
std.mem.Allocator - max_dist :
f32 - include_actors :
bool - include_blocks :
bool
- allocator :
- 返回值类型:
core.Error!types.RayHit - 对应槽位:
edit_trace_ray