Flan (Fabric)

Flan (Fabric)

1M Downloads

[Feature Request]: Entity damage code seems incorrect in 1.21 branch

callumbirks opened this issue ยท 0 comments

commented

Suggestions

The Entity Damage mixin changed method from "hurt" to "isInvulnerableTo", but the return value for preventing damage stayed the same. So now you are returning false if the perm check fails, which will allow the Entity to be hurt.
The code in reference:

@Inject(method = "isInvulnerableTo", at = @At(value = "HEAD"), cancellable = true)
private void onDamage(DamageSource source, CallbackInfoReturnable<Boolean> info) {
if (EntityInteractEvents.preventDamage((Entity) (Object) this, source)) {
info.setReturnValue(false);
info.cancel();
}
}

Solution

Return true if perm check fails in "isInvulnerableTo"