跳转至

Go:实体

函数

ListActors

Go
func ListActors(dim int32) ([]ActorInfo, error)

列出一个维度里的所有实体。只能在服务器线程调用。

  • 参数:
    • dim : int32
  • 返回值类型:([]ActorInfo, error)
  • 对应槽位:list_actors

EntityByID

Go
func EntityByID(id ActorID) Entity

这个唯一 id 的实体,id 就是事件载荷里的 uid。

  • 参数:
    • id : ActorID
  • 返回值类型:Entity

SpawnMob

Go
func SpawnMob(dim int32, typeName string, x, y, z float64) (Entity, error)

生成一个生物,并返回它。

  • 参数:
    • dim : int32
    • typeName : string
    • x : float64
    • y : float64
    • z : float64
  • 返回值类型:(Entity, error)
  • 对应槽位:spawn_mob

Entity

Go
1
2
3
type Entity struct {
    ID ActorID
}

一个实体,由它的唯一 id 指定。

Entity.Snapshot

Go
func (e Entity) Snapshot() (string, error)

这个实体完整的 NBT,以 SNBT 给出。

Entity.Vehicle

Go
func (e Entity) Vehicle() (Entity, error)

这个实体骑着的东西。

Entity.Owner

Go
func (e Entity) Owner() (Entity, error)

这个实体的主人,用于驯服的或召唤出来的实体。

Entity.Target

Go
func (e Entity) Target() (Entity, error)

这个实体当前的目标。

Entity.DistanceTo

Go
func (e Entity) DistanceTo(other Entity) (float64, error)

到另一个实体的距离。

  • 参数:
    • other : Entity
  • 返回值类型:(float64, error)
  • 对应槽位:actor_distance_to

Entity.Clone

Go
func (e Entity) Clone(dim int32, x, y, z float64) (Entity, error)

把这个实体复制到一个位置,返回复制出来的实体。

  • 参数:
    • dim : int32
    • x : float64
    • y : float64
    • z : float64
  • 返回值类型:(Entity, error)
  • 对应槽位:actor_clone

Entity.PosX

Go
func (e Entity) PosX() (float64, error)

读取 PIER_APROP_POS_X:(G) Actor::getPosition().x(玩家的脚下位置要用 getFeetPos;POS_* 用的是 getPosition)

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.PosY

Go
func (e Entity) PosY() (float64, error)

读取 PIER_APROP_POS_Y:(G)

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.PosZ

Go
func (e Entity) PosZ() (float64, error)

读取 PIER_APROP_POS_Z:(G)

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.RotPitch

Go
func (e Entity) RotPitch() (float64, error)

读取 PIER_APROP_ROT_PITCH:(G) Actor::getRotation().x

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.RotYaw

Go
func (e Entity) RotYaw() (float64, error)

读取 PIER_APROP_ROT_YAW:(G) Actor::getRotation().y

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.Dimension

Go
func (e Entity) Dimension() (float64, error)

读取 PIER_APROP_DIMENSION:(G) Actor::getDimensionId

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.Health

Go
func (e Entity) Health() (float64, error)

读取 PIER_APROP_HEALTH:(G) Actor::getHealth;治疗和伤害用动作完成

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.MaxHealth

Go
func (e Entity) MaxHealth() (float64, error)

读取 PIER_APROP_MAX_HEALTH:(G) Actor::getMaxHealth

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.IsAlive

Go
func (e Entity) IsAlive() (bool, error)

读取 PIER_APROP_IS_ALIVE:(G) Actor::isAlive

Entity.IsOnGround

Go
func (e Entity) IsOnGround() (bool, error)

读取 PIER_APROP_IS_ON_GROUND:(G) Actor::isOnGround

Entity.IsInWater

Go
func (e Entity) IsInWater() (bool, error)

读取 PIER_APROP_IS_IN_WATER:(G) Actor::isInWater

Entity.IsInLava

Go
func (e Entity) IsInLava() (bool, error)

读取 PIER_APROP_IS_IN_LAVA:(G) Actor::isInLava

Entity.IsOnFire

Go
func (e Entity) IsOnFire() (bool, error)

读取 PIER_APROP_IS_ON_FIRE:(G) Actor::isOnFire

Entity.IsInvisible

Go
func (e Entity) IsInvisible() (bool, error)

读取 PIER_APROP_IS_INVISIBLE:(G) Actor::isInvisible

Entity.IsSneaking

Go
func (e Entity) IsSneaking() (bool, error)

读取 PIER_APROP_IS_SNEAKING:(G) Actor::isSneaking

Entity.IsBaby

Go
func (e Entity) IsBaby() (bool, error)

读取 PIER_APROP_IS_BABY:(G) Actor::isBaby

Entity.IsRiding

Go
func (e Entity) IsRiding() (bool, error)

读取 PIER_APROP_IS_RIDING:(G) Actor::isRiding

Entity.IsTame

Go
func (e Entity) IsTame() (bool, error)

读取 PIER_APROP_IS_TAME:(G) Actor::isTame

Entity.Speed

Go
func (e Entity) Speed() (float64, error)

读取 PIER_APROP_SPEED:(G) Actor::getSpeedInMetersPerSecond

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.ViewX

Go
func (e Entity) ViewX() (float64, error)

读取 PIER_APROP_VIEW_X:(G) Actor::getViewVector().x

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.ViewY

Go
func (e Entity) ViewY() (float64, error)

读取 PIER_APROP_VIEW_Y:(G) Actor::getViewVector().y

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.ViewZ

Go
func (e Entity) ViewZ() (float64, error)

读取 PIER_APROP_VIEW_Z:(G) Actor::getViewVector().z

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.VelX

Go
func (e Entity) VelX() (float64, error)

读取 PIER_APROP_VEL_X:(G) Actor::getVelocity().x

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.VelY

Go
func (e Entity) VelY() (float64, error)

读取 PIER_APROP_VEL_Y:(G) Actor::getVelocity().y

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.VelZ

Go
func (e Entity) VelZ() (float64, error)

读取 PIER_APROP_VEL_Z:(G) Actor::getVelocity().z

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.HeadX

Go
func (e Entity) HeadX() (float64, error)

读取 PIER_APROP_HEAD_X:(G) Actor::getHeadPos().x

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.HeadY

Go
func (e Entity) HeadY() (float64, error)

读取 PIER_APROP_HEAD_Y:(G) Actor::getHeadPos().y

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.HeadZ

Go
func (e Entity) HeadZ() (float64, error)

读取 PIER_APROP_HEAD_Z:(G) Actor::getHeadPos().z

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.FeetX

Go
func (e Entity) FeetX() (float64, error)

读取 PIER_APROP_FEET_X:(G) Actor::getFeetPos().x

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.FeetY

Go
func (e Entity) FeetY() (float64, error)

读取 PIER_APROP_FEET_Y:(G) Actor::getFeetPos().y

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.FeetZ

Go
func (e Entity) FeetZ() (float64, error)

读取 PIER_APROP_FEET_Z:(G) Actor::getFeetPos().z

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.FallDistance

Go
func (e Entity) FallDistance() (float64, error)

读取 PIER_APROP_FALL_DISTANCE:(G) Actor::getFallDistance

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.IsPersistent

Go
func (e Entity) IsPersistent() (bool, error)

读取 PIER_APROP_IS_PERSISTENT:(G) Actor::isPersistent

Entity.IsLeashed

Go
func (e Entity) IsLeashed() (bool, error)

读取 PIER_APROP_IS_LEASHED:(G) Actor::isLeashed

Entity.IsInvulnerable

Go
func (e Entity) IsInvulnerable() (bool, error)

读取 PIER_APROP_IS_INVULNERABLE:(G) Actor::isInvulnerable

Entity.Variant

Go
func (e Entity) Variant() (float64, error)

读取 PIER_APROP_VARIANT:(G) Actor::getVariant

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.MarkVariant

Go
func (e Entity) MarkVariant() (float64, error)

读取 PIER_APROP_MARK_VARIANT:(G) Actor::getMarkVariant

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.Scale

Go
func (e Entity) Scale() (float64, error)

读取 PIER_APROP_SCALE:(G) Actor::getScaleFactor

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.Brightness

Go
func (e Entity) Brightness() (float64, error)

读取 PIER_APROP_BRIGHTNESS:(G) Actor::getBrightness

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.Radius

Go
func (e Entity) Radius() (float64, error)

读取 PIER_APROP_RADIUS:(G) Actor::getRadius

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.HasTotem

Go
func (e Entity) HasTotem() (bool, error)

读取 PIER_APROP_HAS_TOTEM:(G) Actor::hasTotemEquipped

Entity.IsInRain

Go
func (e Entity) IsInRain() (bool, error)

读取 PIER_APROP_IS_IN_RAIN:(G) Actor::isInRain

Entity.IsInSnow

Go
func (e Entity) IsInSnow() (bool, error)

读取 PIER_APROP_IS_IN_SNOW:(G) Actor::isInSnow

Entity.IsInThunderstorm

Go
func (e Entity) IsInThunderstorm() (bool, error)

读取 PIER_APROP_IS_IN_THUNDERSTORM:(G) Actor::isInThunderstorm

Entity.IsFrozen

Go
func (e Entity) IsFrozen() (bool, error)

读取 PIER_APROP_IS_FROZEN:(G) Actor::isFrozen

Entity.IsInLove

Go
func (e Entity) IsInLove() (bool, error)

读取 PIER_APROP_IS_IN_LOVE:(G) 从 BDS 1.26.40 起不再支持:Actor::isInLove 已被移除

在当前所有的引擎版本上,宿主读这一项都没有结果:(G) 从 BDS 1.26.40 起不再支持:Actor::isInLove 已被移除

Entity.DeathTime

Go
func (e Entity) DeathTime() (float64, error)

读取 PIER_APROP_DEATH_TIME:(G) Actor::getDeathTime

  • 返回值类型:(float64, error)
  • 对应槽位:actor_get_num

Entity.HasPassenger

Go
func (e Entity) HasPassenger() (bool, error)

读取 PIER_APROP_HAS_PASSENGER:(G) Actor::hasPassenger

Entity.TypeName

Go
func (e Entity) TypeName() (string, error)

读取 PIER_ASTR_TYPE_NAME:取自 Actor::getTypeName

Entity.NameTag

Go
func (e Entity) NameTag() (string, error)

读取 PIER_ASTR_NAME_TAG:取自 Actor::getNameTag

Entity.ScoreTag

Go
func (e Entity) ScoreTag() (string, error)

读取 PIER_ASTR_SCORE_TAG:取自 Actor::getScoreTag

Entity.FilteredName

Go
func (e Entity) FilteredName() (string, error)

读取 PIER_ASTR_FILTERED_NAME:取自 Actor::getFilteredNameTag

Entity.Kill

Go
func (e Entity) Kill(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_KILL:调用 Actor::kill

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.Despawn

Go
func (e Entity) Despawn(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_DESPAWN:调用 Actor::despawn

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.Heal

Go
func (e Entity) Heal(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_HEAL:a 为治疗量,调用 Actor::heal

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.SetOnFire

Go
func (e Entity) SetOnFire(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_SET_ON_FIRE:a 为秒数,调用 Actor::setOnFire

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.Teleport

Go
func (e Entity) Teleport(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_TELEPORT:a、b、c 为坐标,sarg 为维度("0" 到 "2"),调用 Actor::teleport

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.SetNameTag

Go
func (e Entity) SetNameTag(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_SET_NAME_TAG:sarg 为名字,调用 Actor::setNameTag

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.AddTag

Go
func (e Entity) AddTag(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_ADD_TAG:sarg 为标签,输出 "0" 或 "1",调用 Actor::addTag

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.RemoveTag

Go
func (e Entity) RemoveTag(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_REMOVE_TAG:sarg 为标签,输出 "0" 或 "1",调用 Actor::removeTag

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.HasTag

Go
func (e Entity) HasTag(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_HAS_TAG:sarg 为标签,输出 "0" 或 "1",调用 Actor::hasTag

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.AddEffect

Go
func (e Entity) AddEffect(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_ADD_EFFECT:sarg 为效果名,a 为刻数,b 为效果等级,c 为是否显示粒子(0 或 1),经 MobEffect::getByName 和 Actor::addEffect 完成

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.RemoveEffect

Go
func (e Entity) RemoveEffect(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_REMOVE_EFFECT:sarg 为效果名,调用 Actor::removeEffect(id)

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.ClearEffects

Go
func (e Entity) ClearEffects(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_CLEAR_EFFECTS:调用 Actor::removeAllEffects

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.Hurt

Go
func (e Entity) Hurt(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_HURT:a 为伤害值(通用伤害来源),调用 Actor::hurt

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.AttributeGet

Go
func (e Entity) AttributeGet(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_ATTRIBUTE_GET:sarg 为属性名("minecraft:health" 等),输出属性值

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.SetVariant

Go
func (e Entity) SetVariant(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_SET_VARIANT:a 为变种值,调用 Actor::setVariant

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.SetMarkVariant

Go
func (e Entity) SetMarkVariant(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_SET_MARK_VARIANT:a 为变种值,调用 Actor::setMarkVariant

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.SetPersistent

Go
func (e Entity) SetPersistent(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_SET_PERSISTENT:调用 Actor::setPersistent

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.SetLeashHolder

Go
func (e Entity) SetLeashHolder(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_SET_LEASH_HOLDER:a 为牵引者的 ActorUniqueID,调用 Actor::setLeashHolder

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.SetInvisible

Go
func (e Entity) SetInvisible(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_SET_INVISIBLE:a 为 0 或 1,调用 Actor::setInvisible

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.SetSneaking

Go
func (e Entity) SetSneaking(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_SET_SNEAKING:a 为 0 或 1,调用 Actor::setSneaking

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.SetNameTagVisible

Go
func (e Entity) SetNameTagVisible(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_SET_NAME_TAG_VISIBLE:a 为 0 或 1,调用 Actor::setNameTagVisible

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.SetTarget

Go
func (e Entity) SetTarget(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_SET_TARGET:a 为目标的 ActorUniqueID,调用 Actor::setTarget

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.SetOwner

Go
func (e Entity) SetOwner(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_SET_OWNER:a 为主人的 ActorUniqueID,调用 Actor::setOwner

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.Burn

Go
func (e Entity) Burn(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_BURN:a 为伤害值,调用 Actor::burn

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.StopFire

Go
func (e Entity) StopFire(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_STOP_FIRE:调用 Actor::extinguishFire

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.SetVelocity

Go
func (e Entity) SetVelocity(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_SET_VELOCITY:a、b、c 为速度,调用 Actor::setVelocity

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.ApplyImpulse

Go
func (e Entity) ApplyImpulse(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_APPLY_IMPULSE:a、b、c 为冲量,调用 Actor::applyImpulse

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.SetScoreTag

Go
func (e Entity) SetScoreTag(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_SET_SCORE_TAG:sarg 为文本,调用 Actor::setScoreTag

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.SetSkinId

Go
func (e Entity) SetSkinId(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_SET_SKIN_ID:a 为皮肤 id,调用 Actor::setSkinID

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.SetStrength

Go
func (e Entity) SetStrength(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_SET_STRENGTH:a 为强度,调用 Actor::setStrength

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.RemoveAllPassengers

Go
func (e Entity) RemoveAllPassengers(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_REMOVE_ALL_PASSENGERS:调用 Actor::removeAllPassengers

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.ExecuteEvent

Go
func (e Entity) ExecuteEvent(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_EXECUTE_EVENT:sarg 为事件名,调用 Actor::executeEvent

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

Entity.SetRotation

Go
func (e Entity) SetRotation(sarg string, a, b, c float64) (string, error)

执行 PIER_AACT_SET_ROTATION:a 为俯仰角,b 为偏航角,调用 Actor::setRotationWrapped

这个动作有输出时,输出就是返回值;每个参数的含义写在 abi.h 里这个常量的注释中。

  • 参数:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • 返回值类型:(string, error)
  • 对应槽位:actor_action

ActorInfo

Go
1
2
3
4
type ActorInfo struct {
    ID   ActorID
    Type string
}

一个维度里的一个实体:它的唯一 id 和类型名。

ActorID

Go
type ActorID int64

实体的唯一 id,即事件载荷里的 uid。0 永远解析不到。

AProp*

名称 值 说明
APropPosX 0 即 PIER_APROP_POS_X:(G) Actor::getPosition().x(玩家的脚下位置要用 getFeetPos;POS_* 用的是 getPosition)
APropPosY 1 即 PIER_APROP_POS_Y:(G)
APropPosZ 2 即 PIER_APROP_POS_Z:(G)
APropRotPitch 3 即 PIER_APROP_ROT_PITCH:(G) Actor::getRotation().x
APropRotYaw 4 即 PIER_APROP_ROT_YAW:(G) Actor::getRotation().y
APropDimension 5 即 PIER_APROP_DIMENSION:(G) Actor::getDimensionId
APropHealth 6 即 PIER_APROP_HEALTH:(G) Actor::getHealth;治疗和伤害用动作完成
APropMaxHealth 7 即 PIER_APROP_MAX_HEALTH:(G) Actor::getMaxHealth
APropIsAlive 8 即 PIER_APROP_IS_ALIVE:(G) Actor::isAlive
APropIsOnGround 9 即 PIER_APROP_IS_ON_GROUND:(G) Actor::isOnGround
APropIsInWater 10 即 PIER_APROP_IS_IN_WATER:(G) Actor::isInWater
APropIsInLava 11 即 PIER_APROP_IS_IN_LAVA:(G) Actor::isInLava
APropIsOnFire 12 即 PIER_APROP_IS_ON_FIRE:(G) Actor::isOnFire
APropIsInvisible 13 即 PIER_APROP_IS_INVISIBLE:(G) Actor::isInvisible
APropIsSneaking 14 即 PIER_APROP_IS_SNEAKING:(G) Actor::isSneaking
APropIsBaby 15 即 PIER_APROP_IS_BABY:(G) Actor::isBaby
APropIsRiding 16 即 PIER_APROP_IS_RIDING:(G) Actor::isRiding
APropIsTame 17 即 PIER_APROP_IS_TAME:(G) Actor::isTame
APropSpeed 18 即 PIER_APROP_SPEED:(G) Actor::getSpeedInMetersPerSecond
APropViewX 19 即 PIER_APROP_VIEW_X:(G) Actor::getViewVector().x
APropViewY 20 即 PIER_APROP_VIEW_Y:(G) Actor::getViewVector().y
APropViewZ 21 即 PIER_APROP_VIEW_Z:(G) Actor::getViewVector().z
APropVelX 22 即 PIER_APROP_VEL_X:(G) Actor::getVelocity().x
APropVelY 23 即 PIER_APROP_VEL_Y:(G) Actor::getVelocity().y
APropVelZ 24 即 PIER_APROP_VEL_Z:(G) Actor::getVelocity().z
APropHeadX 25 即 PIER_APROP_HEAD_X:(G) Actor::getHeadPos().x
APropHeadY 26 即 PIER_APROP_HEAD_Y:(G) Actor::getHeadPos().y
APropHeadZ 27 即 PIER_APROP_HEAD_Z:(G) Actor::getHeadPos().z
APropFeetX 28 即 PIER_APROP_FEET_X:(G) Actor::getFeetPos().x
APropFeetY 29 即 PIER_APROP_FEET_Y:(G) Actor::getFeetPos().y
APropFeetZ 30 即 PIER_APROP_FEET_Z:(G) Actor::getFeetPos().z
APropFallDistance 31 即 PIER_APROP_FALL_DISTANCE:(G) Actor::getFallDistance
APropIsPersistent 32 即 PIER_APROP_IS_PERSISTENT:(G) Actor::isPersistent
APropIsLeashed 33 即 PIER_APROP_IS_LEASHED:(G) Actor::isLeashed
APropIsInvulnerable 34 即 PIER_APROP_IS_INVULNERABLE:(G) Actor::isInvulnerable
APropVariant 35 即 PIER_APROP_VARIANT:(G) Actor::getVariant
APropMarkVariant 36 即 PIER_APROP_MARK_VARIANT:(G) Actor::getMarkVariant
APropScale 37 即 PIER_APROP_SCALE:(G) Actor::getScaleFactor
APropBrightness 38 即 PIER_APROP_BRIGHTNESS:(G) Actor::getBrightness
APropRadius 39 即 PIER_APROP_RADIUS:(G) Actor::getRadius
APropHasTotem 40 即 PIER_APROP_HAS_TOTEM:(G) Actor::hasTotemEquipped
APropIsInRain 41 即 PIER_APROP_IS_IN_RAIN:(G) Actor::isInRain
APropIsInSnow 42 即 PIER_APROP_IS_IN_SNOW:(G) Actor::isInSnow
APropIsInThunderstorm 43 即 PIER_APROP_IS_IN_THUNDERSTORM:(G) Actor::isInThunderstorm
APropIsFrozen 44 即 PIER_APROP_IS_FROZEN:(G) Actor::isFrozen
APropIsInLove 45 这个常量在当前的引擎版本上取不到值:即 PIER_APROP_IS_IN_LOVE:(G) 从 BDS 1.26.40 起不再支持:Actor::isInLove 已被移除
APropDeathTime 46 即 PIER_APROP_DEATH_TIME:(G) Actor::getDeathTime
APropHasPassenger 47 即 PIER_APROP_HAS_PASSENGER:(G) Actor::hasPassenger

AStr*

名称 值 说明
AStrTypeName 0 即 PIER_ASTR_TYPE_NAME:取自 Actor::getTypeName
AStrNameTag 1 即 PIER_ASTR_NAME_TAG:取自 Actor::getNameTag
AStrScoreTag 2 即 PIER_ASTR_SCORE_TAG:取自 Actor::getScoreTag
AStrFilteredName 3 即 PIER_ASTR_FILTERED_NAME:取自 Actor::getFilteredNameTag

AAct*

名称 值 说明
AActKill 0 即 PIER_AACT_KILL:调用 Actor::kill
AActDespawn 1 即 PIER_AACT_DESPAWN:调用 Actor::despawn
AActHeal 2 即 PIER_AACT_HEAL:a 为治疗量,调用 Actor::heal
AActSetOnFire 3 即 PIER_AACT_SET_ON_FIRE:a 为秒数,调用 Actor::setOnFire
AActTeleport 4 即 PIER_AACT_TELEPORT:a、b、c 为坐标,sarg 为维度("0" 到 "2"),调用 Actor::teleport
AActSetNameTag 5 即 PIER_AACT_SET_NAME_TAG:sarg 为名字,调用 Actor::setNameTag
AActAddTag 6 即 PIER_AACT_ADD_TAG:sarg 为标签,输出 "0" 或 "1",调用 Actor::addTag
AActRemoveTag 7 即 PIER_AACT_REMOVE_TAG:sarg 为标签,输出 "0" 或 "1",调用 Actor::removeTag
AActHasTag 8 即 PIER_AACT_HAS_TAG:sarg 为标签,输出 "0" 或 "1",调用 Actor::hasTag
AActAddEffect 9 即 PIER_AACT_ADD_EFFECT:sarg 为效果名,a 为刻数,b 为效果等级,c 为是否显示粒子(0 或 1),经 MobEffect::getByName 和 Actor::addEffect 完成
AActRemoveEffect 10 即 PIER_AACT_REMOVE_EFFECT:sarg 为效果名,调用 Actor::removeEffect(id)
AActClearEffects 11 即 PIER_AACT_CLEAR_EFFECTS:调用 Actor::removeAllEffects
AActHurt 12 即 PIER_AACT_HURT:a 为伤害值(通用伤害来源),调用 Actor::hurt
AActAttributeGet 13 即 PIER_AACT_ATTRIBUTE_GET:sarg 为属性名("minecraft:health" 等),输出属性值
AActSetVariant 14 即 PIER_AACT_SET_VARIANT:a 为变种值,调用 Actor::setVariant
AActSetMarkVariant 15 即 PIER_AACT_SET_MARK_VARIANT:a 为变种值,调用 Actor::setMarkVariant
AActSetPersistent 16 即 PIER_AACT_SET_PERSISTENT:调用 Actor::setPersistent
AActSetLeashHolder 17 即 PIER_AACT_SET_LEASH_HOLDER:a 为牵引者的 ActorUniqueID,调用 Actor::setLeashHolder
AActSetInvisible 18 即 PIER_AACT_SET_INVISIBLE:a 为 0 或 1,调用 Actor::setInvisible
AActSetSneaking 19 即 PIER_AACT_SET_SNEAKING:a 为 0 或 1,调用 Actor::setSneaking
AActSetNameTagVisible 20 即 PIER_AACT_SET_NAME_TAG_VISIBLE:a 为 0 或 1,调用 Actor::setNameTagVisible
AActSetTarget 21 即 PIER_AACT_SET_TARGET:a 为目标的 ActorUniqueID,调用 Actor::setTarget
AActSetOwner 22 即 PIER_AACT_SET_OWNER:a 为主人的 ActorUniqueID,调用 Actor::setOwner
AActBurn 23 即 PIER_AACT_BURN:a 为伤害值,调用 Actor::burn
AActStopFire 24 即 PIER_AACT_STOP_FIRE:调用 Actor::extinguishFire
AActSetVelocity 25 即 PIER_AACT_SET_VELOCITY:a、b、c 为速度,调用 Actor::setVelocity
AActApplyImpulse 26 即 PIER_AACT_APPLY_IMPULSE:a、b、c 为冲量,调用 Actor::applyImpulse
AActSetScoreTag 27 即 PIER_AACT_SET_SCORE_TAG:sarg 为文本,调用 Actor::setScoreTag
AActSetSkinId 28 即 PIER_AACT_SET_SKIN_ID:a 为皮肤 id,调用 Actor::setSkinID
AActSetStrength 29 即 PIER_AACT_SET_STRENGTH:a 为强度,调用 Actor::setStrength
AActRemoveAllPassengers 30 即 PIER_AACT_REMOVE_ALL_PASSENGERS:调用 Actor::removeAllPassengers
AActExecuteEvent 31 即 PIER_AACT_EXECUTE_EVENT:sarg 为事件名,调用 Actor::executeEvent
AActSetRotation 32 即 PIER_AACT_SET_ROTATION:a 为俯仰角,b 为偏航角,调用 Actor::setRotationWrapped