Entity - 实体
实体类
Entity.getLocalPlayer()
描述: 获取当前本地玩家。
返回值:
Entity示例代码:
Entity.getEntityName(Entity)
描述: 获取实体的名称。
参数:
Entity返回值: 实体名称。
string示例代码:
Entity.getEntityLevel(entity)
描述: 获取实体的Level指针。
参数:
Entity返回值:
Level示例代码:
Entity.getEntityPos(entity)
描述: 获取实体的坐标。
参数:
Entity返回值: 实体的坐标向量数组
Vec3示例代码:
Entity.getEntityMotion(entity)
描述: 获取实体的运动状态向量。
参数:
Entity返回值: 向量数组
Vec3示例代码:
Entity.getEntityAABB(entity)
描述: 获取实体的 AABB (Axis-Aligned Bounding Box)。
参数:
Entity返回值: AABB数组
Vec6示例代码:
Entity.getEntityRuntimeId(entity)
描述: 获取实体的运行时 ID。
参数:
Entity返回值: 实体的运行时 ID。
number示例代码:
Entity.isInWater(entity)
描述: 判断实体是否在水中。
参数:
Entity返回值:
bool注意: 若实体在水中则为
true,否则为false。
Entity.getEntityType(entity)
描述: 获取实体的类型。
参数:
Entity返回值:
number
Entity.removeEntity(entity)
描述: 移除指定实体。(使本地不可见)
参数:
Entity
Entity.isInVisible(entity)
描述: 判断实体是否可见。
参数:
Entity返回值:
bool注意: 若实体可见则为
true,否则为false。
Entity.swing(entity)
描述: 实体挥手动作。
参数:
Entity注意: 似乎只对本地玩家生效。
Entity.setEntityMotion(entity, x, y, z)
描述: 设置实体的运动状态。
参数:
Entity- 实体对象。x- 运动的 X 轴分量。y- 运动的 Y 轴分量。z- 运动的 Z 轴分量。
Entity.isAlive(entity)
描述: 判断实体是否活着。
参数:
Entity返回值:
bool注意: 若实体存活则为
true,否则为false。
Entity.setBodyRot(entity, y)
描述: 设置实体的身体旋转角度。
参数:
Entity- 实体对象。y- Y 轴的旋转角度。
Entity.setHeadRot(entity, y)
描述: 设置实体的头部旋转角度。
参数:
Entity- 实体对象。y- Y 轴的旋转角度。
Entity.isOnGround(entity)
描述: 判断实体是否在地面上。
参数:
Entity返回值:
bool注意: 若实体在地面上则为
true,否则为false。
Entity.setIsOnGround(entity, state)
描述: 设置实体是否在地面上。
参数:
Entity- 实体对象。state- 布尔值,若为true,实体将被设置为在地面上。
Entity.isJumping(entity)
描述: 判断实体是否正在跳跃。(可用于判断是否点击跳跃键)
参数:
Entity- 实体对象。返回值:
bool注意: 若实体正在跳跃则为
true,否则为false。
Entity.isPlayer(entity)
描述: 判断实体是否为玩家。
参数:
Entity- 实体对象。返回值:
bool注意: 若是为
true,否则为false。
Entity.getPlayerList()
描述: 获取目前世界的所有玩家。
返回值: 玩家数组。
VectorN*
Entity.getEntityList()
描述: 获取目前世界的所有实体。
返回值: 实体数组。
VectorN*