:info: I used a firework rocket with a flight duration of 127 to demonstrate the bug, but it also occurs in survival mode without any cheats and with a flight duration of 3 (or less).
What I expected to happen:
The boost of a firework rocket vanishes after landing
What actually happened:
After landing, particles still come out of my body. When I launch myself up again, I am immediately boosted
How to reproduce
Equip an elytra and give yourself a long duration rocket.
/give @s minecraft:firework_rocket{Fireworks:{Flight:127b}}
Active the elytra and shoot a firework rocket.
Land on the ground and active the elytra again.
→ ❌ You are being boosted again
Code analysis
Code analysis by @unknown can be found in this comment
Linked issues
is duplicated by 10
relates to 2
Attachments
Comments 5
This is only for fireworks that last long enough for players to not use another one. This find can be used to benefit custom maps that require a specific function in the game to make it unique. Plus, the firework itself will eventually end, making infinite flight unachievable.
The player can still activate this in survival mode with a duration 3 rocket.
Also, the bug is still active in 1.13-pre4
The following is based on yarn 1.15.1 names.
In the method net.minecraft.entity.FireworkEntity.tick
the if-statement where it kills the firework does not check for if the player is not flying anymore. It only checks if the life of the firework is greater than the lifetime and kills it if true. To fix this, a check should be added for if the player is still elytra flying as so
if (!this.world.isClient && this.life > this.lifeTime || !this.shooter.isFallFlying()) {
...
}
This kills the entity if life is greater than lifetime OR if the shooter isn't flying the elytra. Hope this helps fixing the issue!😃
Can confirm for MC 1.12.1.