mojira.dev
MC-111534

The firework rocket use statistic doesn't count rockets used for elytra boosting

The bug

The statistic minecraft.used:minecraft.firework_rocket is incremented when a firework rocket is launched normally, but not when it is used to boost an elytra.
There appears to be no reliable way to detect the usage of a rocket as a booster using commands.

Steps to Reproduce:

  • Run the following commands:

/scoreboard objectives add firework minecraft.used:minecraft.firework_rocket
/scoreboard objectives setdisplay sidebar firework
/scoreboard players set @a firework 0

Launch a firework rocket on the ground normally.
→ ✔ The scores increased by 1.
Fly with an elytra and boost yourself with a firework rocket.
→ ❌ The score does not increase.

Code analysis

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

Linked issues

Attachments

Comments 11

This happens because the stats are increased automatically when a right click on a block succeeds, and all items that can be right clicked in the air have their own code to increase stats. The fireworks don't have any of that code, so they use the automatic stat increasing system when right clicked on a block, but no stats are modified when it's right clicked in air (to boost elytra flight).

The fix would be to add that one line of code to increase the use stats when fireworks are right clicked in air. Using MCP names, that would be playerIn.addStat(StatList.getObjectUseStats(this));
inside ItemFireworks.onItemRightClick.

Confirmed in 20w13b

Confirmed in 20w15a

 

Confirmed in 20w48a

Can confirm in 21w03a.

1 more comments

Can confirm in 21w05b. Here are some steps to reproduce this issue:

Steps to Reproduce:

  • Run the following commands:

/scoreboard objectives add firework minecraft.used:minecraft.firework_rocket
/scoreboard objectives setdisplay sidebar firework
/scoreboard players set @a firework 0
  • Launch a firework rocket on the ground normally.
    → ✔  The scores increased by 1.

  • Fly with an elytra and boost yourself with a firework rocket.
    → ❌  The score does not increase.

Can confirm in 21w06a.

Can confirm in 21w07a.

Can confirm in 21w08b. Video attached.

Can confirm in 21w11a. I'd like to request ownership of this ticket since the current reporter has been inactive since December 2016. I'm willing to provide all of the necessary information and will keep this report updated.

Enoch Vear

Avoma

slicedlime

Confirmed

Normal

Statistics

elytra, firework_rocket, statistics

Minecraft 16w50a, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 1.12.2, Minecraft 18w03b, ..., 21w08b, 21w11a, 21w13a, 21w14a, 21w15a

21w16a

Retrieved