mojira.dev
MC-249698

Dragon's Breath created by dragon on fountain can still be bottled after it "runs out"

Bug
Dragon's Breath at the "bedrock fountain" can be bottled for longer than expected. It can be bottled for as long as the entity persists, even when the breath visually disappears.

Expected Result
When bottling, once the size of the hitbox is reduced to zero, the entity will no longer be able to be bottled and/or the entity will disappear.

Observed Result
Once the size of the hitbox is reduced to zero, it can still be bottled until the entity de-spawns, meaning it can be bottled for far longer then expected.

Attached is a video demonstrating the bug in a vanilla world.

Note - The breath from the purple fireballs she shoots appear to work as intended.

Linked issues

Attachments

Comments 3

Can confirm on 22w14a, indeed only seems to happen with breath from the fountain.

Code analysis (Mojang mappings, 1.19.4 Pre-release 3): this seems to happen only with breath from the fountain because the dragon directly spawns an area effect cloud instead of using a fireball. In DragonFireball#onHit(...), the spawned area effect cloud gets its radius constantly increased due to a set radiusPerTick; however, in DragonSittingFlamingPhase#doServerTick(), the area effect cloud does not get a set radiusPerTick, so it defaults to zero; the same happens to its radiusOnUse. However, the area effect cloud is only discarded due to its radius if its radius is zero if either the radiusPerTick or radiusOnUse are different than zero (this can be seen in AreaEffectCloud#tick()), which is the case only for area effect clouds created by dragon fireballs, and not by the dragon flaming on the fountain.

This might be intended for mapmakers to create area effect clouds with a radius of zero. If this is intended, a simple fix would be to add a check for the radius of the area effect cloud in BottleItem#use(...), to guarantee that you can't bottle an area effect cloud with a radius of zero. For example, instead of the current:

List<AreaEffectCloud> $$3 = $$02.getEntitiesOfClass(AreaEffectCloud.class, $$1.getBoundingBox().inflate(2.0), (? super T $$0) -> $$0 != null && $$0.isAlive() && $$0.getOwner() instanceof EnderDragon);

it would be:

List<AreaEffectCloud> $$3 = $$02.getEntitiesOfClass(AreaEffectCloud.class, $$1.getBoundingBox().inflate(2.0), (? super T $$0) -> $$0 != null && $$0.isAlive() && $$0.getOwner() instanceof EnderDragon && $$0.getRadius() > 0);

(Or this could be fixed by simply adding a radiusPerTick to the flaming dragon's area effect cloud, which would be consistent with the dragon fireball behavior.)

@unknown Since you are the reporter, you can add newer versions to the Affected Versions list yourself.

Tristan Lansdown

(Unassigned)

Confirmed

Platform

Low

Entities

1.18.2, 22w14a, 22w15a, 1.19.3, 1.19.4 Pre-release 3, 1.19.4, 1.20.2, 1.20.5, 1.21

Retrieved