Architectury API (UNUSED)

Architectury API (UNUSED)

9M Downloads

[BUG] Crashed while attacking Ender Dragon

QiuShui1012 opened this issue ยท 1 comments

commented

This is the stacktrace: mclo.gs

Destription:
When I tried to hit Ender Dragon, the game crashed. No matter which part of it, head or body, the game will immediately crash.

commented

I guess this method caused the crash:

In dev.architectury.mixin.fabric.MixinEntity, line 37:

@Inject(method = "hurtClient", at = @At("HEAD"), cancellable = true)
private void hurtClient(DamageSource damageSource, CallbackInfoReturnable<Boolean> cir) {
    if ((Object) this instanceof Player) return;
    if (EntityEvent.LIVING_HURT.invoker().hurt((LivingEntity) (Object) this, damageSource, 0).isFalse()) {
        cir.setReturnValue(false);
    }
}

Within this method, the second if statement casts this to LivingEntity. However, when hitting the Ender Dragon, the class that calls this method is EnderDragonPart, which does not extend LivingEntity, causing the game to crash.