This is my LivingEntity#travel method mixin which in my head was supposed to cancel any movement with the only exception of falling, however it cancels falling too for both players and regular entities. Any ideas how to fix it?
@Inject(
method = "travel",
at = @At(value = "HEAD"),
cancellable = true
)
private void blockMovement(Vec3 vector, CallbackInfo callbackInfo) {
var entity = (LivingEntity) (Object) this;
if (!entity.hasEffect(DotcEffects.STUN))
return;
if (entity.getDeltaMovement().y < 0 && !entity.onGround())
return;
entity.setDeltaMovement(0, 0, 0);
callbackInfo.cancel();
}