mojira.dev
MC-187100

End crystals try to heal dying Ender dragons

The bug

End crystals are extremely loyal to the dragon and would uselessly try to heal her even when she's dying. The beam is still present even after detonating the crystal until the dragon is fully gone.

Code analysis

Code analysis by @unknown can be found in this comment.

Attachments

Comments 2

Can confirm in 20w51a.

Code Analysis - Mojang Mappings 1.17.1 - Client-Side
net.minecraft.client.renderer.EnderDragonRenderer

public void render(EnderDragon lvt1, float lvt2, float lvt3, PoseStack lvt4, MultiBufferSource lvt5, int lvt6) {
    ...
    //Renders the nearest crystal
    if (lvt1.nearestCrystal != null) { //To fix this only for the clients change to: (lvt1.dragonDeathTime > 0 && lvt1.nearestCrystal != null)
        lvt4.pushPose();
        float lvt11 = (float)(lvt1.nearestCrystal.getX() - Mth.lerp((double)lvt3, lvt1.xo, lvt1.getX()));
        float lvt12 = (float)(lvt1.nearestCrystal.getY() - Mth.lerp((double)lvt3, lvt1.yo, lvt1.getY()));
        float lvt13 = (float)(lvt1.nearestCrystal.getZ() - Mth.lerp((double)lvt3, lvt1.zo, lvt1.getZ()));
        EnderDragonRenderer.renderCrystalBeams(lvt11,lvt12+EndCrystalRenderer.getY(lvt1.nearestCrystal,lvt3),lvt13,lvt3,lvt1.tickCount,lvt4,lvt5,lvt6);
        lvt4.popPose();
    }
    super.render(lvt1, lvt2, lvt3, lvt4, lvt5, lvt6);
}
public void render(EnderDragon lvt1, float lvt2, float lvt3, PoseStack lvt4, MultiBufferSource lvt5, int lvt6) {
    ...
    //Renders the nearest crystal
    if (lvt1.nearestCrystal != null) { //To fix this only for the clients change to: (lvt1.dragonDeathTime > 0 && lvt1.nearestCrystal != null)
        lvt4.pushPose();
        float lvt11 = (float)(lvt1.nearestCrystal.getX() - Mth.lerp((double)lvt3, lvt1.xo, lvt1.getX()));
        float lvt12 = (float)(lvt1.nearestCrystal.getY() - Mth.lerp((double)lvt3, lvt1.yo, lvt1.getY()));
        float lvt13 = (float)(lvt1.nearestCrystal.getZ() - Mth.lerp((double)lvt3, lvt1.zo, lvt1.getZ()));
        EnderDragonRenderer.renderCrystalBeams(lvt11,lvt12+EndCrystalRenderer.getY(lvt1.nearestCrystal,lvt3),lvt13,lvt3,lvt1.tickCount,lvt4,lvt5,lvt6);
        lvt4.popPose();
    }
    super.render(lvt1, lvt2, lvt3, lvt4, lvt5, lvt6);
}

JaloTheMusician

(Unassigned)

Confirmed

Entities, Mob behaviour

1.15.2, 20w22a, 1.16 Pre-release 2, 1.16 Pre-release 3, 1.16 Pre-release 4, ..., 1.19.4, 23w16a, 1.20.4, 24w09a, 25w45a

Retrieved