LogoArcartX Doc
服务端Aria实体对象

实体移动

实体对象:冲刺、位移、瞬移、起跳等高级移动

  • 以下函数的目标对象为生物实体LivingEntity)。玩家也是生物实体,因此这些函数对玩家目标同样有效。
  • 「瞬移」类函数(teleportXxx)会自动寻找安全落点后再传送;「冲刺」类函数(dashXxx)通过设置速度实现位移。

teleportForward(distance)

  • 沿实体朝向向前瞬移指定距离(自动寻找安全落点)
  • 参数distance — 双精度浮点数类型,瞬移距离
  • 返回值:无
  • 调用示例
实体对象.teleportForward(3.0)

teleportBack(distance)

  • 沿实体朝向向后瞬移指定距离(自动寻找安全落点)
  • 参数distance — 双精度浮点数类型,瞬移距离
  • 返回值:无
  • 调用示例
实体对象.teleportBack(3.0)

teleportLeft(distance)

  • 沿实体朝向向左瞬移指定距离(自动寻找安全落点)
  • 参数distance — 双精度浮点数类型,瞬移距离
  • 返回值:无
  • 调用示例
实体对象.teleportLeft(3.0)

teleportRight(distance)

  • 沿实体朝向向右瞬移指定距离(自动寻找安全落点)
  • 参数distance — 双精度浮点数类型,瞬移距离
  • 返回值:无
  • 调用示例
实体对象.teleportRight(3.0)

teleportUp(distance)

  • 向上瞬移指定距离(自动寻找安全落点)
  • 参数distance — 双精度浮点数类型,瞬移距离
  • 返回值:无
  • 调用示例
实体对象.teleportUp(3.0)

teleportDown(distance)

  • 向下瞬移指定距离(自动寻找安全落点)
  • 参数distance — 双精度浮点数类型,瞬移距离
  • 返回值:无
  • 调用示例
实体对象.teleportDown(3.0)

dashAdvanced(forward, strafe, vertical)

  • 高级冲刺:按前后 / 左右 / 垂直三个方向的分量设置速度
  • 参数
    • forward — 双精度浮点数类型,前后分量(正值向前,负值向后)
    • strafe — 双精度浮点数类型,左右分量(正值向右,负值向左)
    • vertical — 双精度浮点数类型,垂直分量
  • 返回值:无
  • 调用示例
实体对象.dashAdvanced(1.2, 0.0, 0.3)

dash(horizontal, vertical)

  • 沿实体朝向向前冲刺
  • 参数
    • horizontal — 双精度浮点数类型,水平方向速度
    • vertical — 双精度浮点数类型,垂直方向速度
  • 返回值:无
  • 调用示例
实体对象.dash(1.2, 0.3)

dashBack(horizontal, vertical)

  • 沿实体朝向向后冲刺
  • 参数
    • horizontal — 双精度浮点数类型,水平方向速度
    • vertical — 双精度浮点数类型,垂直方向速度
  • 返回值:无
  • 调用示例
实体对象.dashBack(1.2, 0.3)

dashLeft(horizontal, vertical)

  • 沿实体朝向向左冲刺
  • 参数
    • horizontal — 双精度浮点数类型,水平方向速度
    • vertical — 双精度浮点数类型,垂直方向速度
  • 返回值:无
  • 调用示例
实体对象.dashLeft(1.2, 0.3)

dashRight(horizontal, vertical)

  • 沿实体朝向向右冲刺
  • 参数
    • horizontal — 双精度浮点数类型,水平方向速度
    • vertical — 双精度浮点数类型,垂直方向速度
  • 返回值:无
  • 调用示例
实体对象.dashRight(1.2, 0.3)

jump(force)

  • 让实体向上起跳(设置垂直向上速度)
  • 参数force — 双精度浮点数类型,起跳力度
  • 返回值:无
  • 调用示例
实体对象.jump(0.6)

dive(force)

  • 让实体向下俯冲(设置垂直向下速度)
  • 参数force — 双精度浮点数类型,俯冲力度
  • 返回值:无
  • 调用示例
实体对象.dive(0.6)

bounce()

  • 将实体当前速度反向(回弹)
  • 参数:无
  • 返回值:无
  • 调用示例
实体对象.bounce()