TCmc
比如判断玩家是否在游泳
  • isSwimming
    boolean isSwimming()
    [color=var(--color-text)]Checks to see if an entity is swimming.
    返回:True if this entity is swimming.







戒灵领域
PlayerMoveEvent

桃源村服主

这个是监听一切移动的,也就是说包括下落、飞行、游泳

‮tcejorPoiK
https://papermc.io/javadocs/pape ... it/entity/Pose.html
Pose.STANDING 应该是正常站立或行走

你可能还需要判断 player#isSprinting() 玩家是否在疾跑,以及 player#isOnGround() 玩家是否在地面上,这些需要你自己测试一下

RE_OVO
  1. val pose = Player#getPose()

  2. // 在行走或者潜行
  3. if(pose == Pose.STANDING || pose == Pose.SNEAKING) {
  4.   // 确保不在水中行走
  5.   if(!player.location.block.isLiquid) {
  6.      // 在陆地上行走
  7.   }
  8. }
复制代码

1952110084
判断玩家是否在疾跑有办法吗?