The bug
Firework explosions don't deal damage to numerous amounts of entities.
Affected entities
Ender dragons
End crystals
Boats
Minecarts
Paintings
Item frames
Leads
How to reproduce
Obtain a crossbow and some fireworks
/give @s minecraft:crossbow /give @s minecraft:firework_rocket{Fireworks:{Flight:1,Explosions:[{Type:1,Flicker:1,Trail:1,Colors:[I;12801229],FadeColors:[I;11743532]}]}} 64
Load a firework into the crossbow
Summon one of the affected entities listed above
Take note as to whether or not the entity of your choice is damaged by the firework explosion
→ ❌ Firework explosions don't deal damage to numerous amounts of entities.
Expected behavior
Firework explosions would deal damage to all entities.
Code Analysis
Code analysis done by @unknown
The reason this is happening is that when the explosion damage is happening it only checks from living entities which excludes End Crystals and Ender Dragons. Changing it to check for all Entities fixes it
Current Code
net/minecraft/world/entity/projectile/FireworkRocketEntity.java
private void dealExplosionDamage() {
...
for(LivingEntity livingentity : this.level.getEntitiesOfClass(LivingEntity.class, this.getBoundingBox().inflate(5.0D))) {
if (livingentity != this.attachedToEntity && !(this.distanceToSqr(livingentity) > 25.0D)) {
boolean flag = false;
for(int i = 0; i < 2; ++i) {
Vec3 vec31 = new Vec3(livingentity.getX(), livingentity.getY(0.5D * (double)i), livingentity.getZ());
HitResult hitresult = this.level.clip(new ClipContext(vec3, vec31, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, this));
if (hitresult.getType() == HitResult.Type.MISS) {
flag = true;
break;
}
}
}
...
Fixed Code
net/minecraft/world/entity/projectile/FireworkRocketEntity.java
private void dealExplosionDamage() {
...
//Changing from Living Entity to Entity fixes MC-111442
for(Entity entity: this.level.getEntitiesOfClass(Entity.class, this.getBoundingBox().inflate(5.0D))) {
if (entity != this.attachedToEntity && !(this.distanceToSqr(livingentity) > 25.0D)) {
boolean flag = false;
for(int i = 0; i < 2; ++i) {
Vec3 vec31 = new Vec3(entity.getX(), entity.getY(0.5D * (double)i), entity.getZ());
HitResult hitresult = this.level.clip(new ClipContext(vec3, vec31, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, this));
if (hitresult.getType() == HitResult.Type.MISS) {
flag = true;
break;
}
}
//Deny items and experience being destroyed by the rocket
//Could probably be done better
if(entity instanceof ItemEntity || entity instanceof ExperienceOrb)
{
flag = false;
}
...
Linked issues
is duplicated by 8
Attachments
Comments 27
Can confirm for 1.13.2 and 18w43c. The fireworks shot by the new crossbow don't damage to any of these entities. This should be fixed before the Village and Pillage release because blowing up the ender dragon would be a great way to beat the game.
While obviously a bug, if fixed, the fireworks' ability to destroy End crystals might have balance implications as one could just climb onto an End spike and easily destroy crystals on nearby spikes with rockets. Using arrows or snowballs for the same requires some targeting skill as they follow an arcing trajectory - with crossbows (or "rocket propelled grenade launchers" if you ask me) you would just point and shoot. It would trivialize the Ender Dragon fight even further.
We are unable to diagnose your issue due to the lack of proper debug information. Please review the guidelines before reporting issues.
In case of a game crash, please also attach the crash log from
[minecraft/crash-reports/crash-<DATE>-client.txt|http://hopper.minecraft.net/help/finding-minecraft-data-folder]
.-- I am a bot. This action was performed automagically!