服务端Aria实体对象
实体移动
实体对象:冲刺、位移、瞬移、起跳等高级移动
- 以下函数的目标对象为生物实体(
LivingEntity)。玩家也是生物实体,因此这些函数对玩家目标同样有效。 - 「瞬移」类函数(
teleportXxx)会自动寻找安全落点后再传送;「冲刺」类函数(dashXxx)通过设置速度实现位移。
teleportForward(distance)
- 沿实体朝向向前瞬移指定距离(自动寻找安全落点)
- 参数:
distance— 双精度浮点数类型,瞬移距离 - 返回值:无
- 调用示例
teleportBack(distance)
- 沿实体朝向向后瞬移指定距离(自动寻找安全落点)
- 参数:
distance— 双精度浮点数类型,瞬移距离 - 返回值:无
- 调用示例
teleportLeft(distance)
- 沿实体朝向向左瞬移指定距离(自动寻找安全落点)
- 参数:
distance— 双精度浮点数类型,瞬移距离 - 返回值:无
- 调用示例
teleportRight(distance)
- 沿实体朝向向右瞬移指定距离(自动寻找安全落点)
- 参数:
distance— 双精度浮点数类型,瞬移距离 - 返回值:无
- 调用示例
teleportUp(distance)
- 向上瞬移指定距离(自动寻找安全落点)
- 参数:
distance— 双精度浮点数类型,瞬移距离 - 返回值:无
- 调用示例
teleportDown(distance)
- 向下瞬移指定距离(自动寻找安全落点)
- 参数:
distance— 双精度浮点数类型,瞬移距离 - 返回值:无
- 调用示例
dashAdvanced(forward, strafe, vertical)
- 高级冲刺:按前后 / 左右 / 垂直三个方向的分量设置速度
- 参数:
forward— 双精度浮点数类型,前后分量(正值向前,负值向后)strafe— 双精度浮点数类型,左右分量(正值向右,负值向左)vertical— 双精度浮点数类型,垂直分量
- 返回值:无
- 调用示例
dash(horizontal, vertical)
- 沿实体朝向向前冲刺
- 参数:
horizontal— 双精度浮点数类型,水平方向速度vertical— 双精度浮点数类型,垂直方向速度
- 返回值:无
- 调用示例
dashBack(horizontal, vertical)
- 沿实体朝向向后冲刺
- 参数:
horizontal— 双精度浮点数类型,水平方向速度vertical— 双精度浮点数类型,垂直方向速度
- 返回值:无
- 调用示例
dashLeft(horizontal, vertical)
- 沿实体朝向向左冲刺
- 参数:
horizontal— 双精度浮点数类型,水平方向速度vertical— 双精度浮点数类型,垂直方向速度
- 返回值:无
- 调用示例
dashRight(horizontal, vertical)
- 沿实体朝向向右冲刺
- 参数:
horizontal— 双精度浮点数类型,水平方向速度vertical— 双精度浮点数类型,垂直方向速度
- 返回值:无
- 调用示例
jump(force)
- 让实体向上起跳(设置垂直向上速度)
- 参数:
force— 双精度浮点数类型,起跳力度 - 返回值:无
- 调用示例
dive(force)
- 让实体向下俯冲(设置垂直向下速度)
- 参数:
force— 双精度浮点数类型,俯冲力度 - 返回值:无
- 调用示例
bounce()
- 将实体当前速度反向(回弹)
- 参数:无
- 返回值:无
- 调用示例
