ZANXEY Thank you,these are exactly what I want. I tried the safewalk module of Alien client, copied its event bus, impl and mixin, and now it works well.
By the way, let me mention something strange.Previously, in Wrust , I didn't use
@Inject(at = @At("HEAD"), method = "move(Lnet/minecraft/entity/MovementType;Lnet/minecraft/util/math/Vec3d;)V") private void onMove(MovementType type, Vec3d offset, CallbackInfo ci) { EventManager.fire(PlayerMoveEvent.INSTANCE); }
Instead, I used ClientTickEvents.END_CLIENT_TICK.register(client -> {})
, which caused the player to run off ledges while sprinting.
Now that I’ve switched to using a mixin of move method , the issue is resolved.