mojira.dev
MC-248076

Specific type of Firework Rockets won't stack with each other after use

This only happens when firework rockets are generated via command with no NBT data other than a custom display or name (meaning no decoration). When the stack is split in some way and one of the smaller stacks is used, that second stack loses the ability to stack with the unused set. This includes use when launched, used with an elytra, and shot out of a dispenser. When an additional stack is used, it can combine with the other used stack again.

Further inspection with advanced tooltips shows that the number of NBT tags changes from 1 to 2, and an even closer look reveals that "Fireworks": {} is added to the NBT after a stack is used.

The attached video shows this in detail (poor quality to fit under the 10MB limit).

Attachments

Comments 5

⚠️ Please do not mark Unreleased Versions as affected. You don't have access to them yet.

-- I am a bot. This action was performed automatically! If you think it was incorrect, please notify us on Discord or Reddit

This issue could possibly be related to MC-5413 and MC-17336

Confirmed in 1.20.3 pre 2

Also here is the updated command that works

/give @p minecraft:firework_rocket{display:{Name:'{"text":"Bug Report","color":"red"}'}} 16

When the player uses the firework rocket item, the game adds an empty "Firework {}" tag to the item stack, leading to the inability to stack.

Here, the first item is one which was not used, and the second was.

[media]

The source seems to be 'appendTooltip()' inside FireworkRocketItem (MCP 1.20.2) where the game tries to append the "Firework {Flight: [x]}" tag, but since the rocket does not have a flight duration the tag is just left empty.

@Override
	public void appendTooltip(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) {
		NbtCompound nbtCompound = stack.getSubNbt("Fireworks");
		if (nbtCompound != null) {
			if (nbtCompound.contains("Flight", NbtElement.NUMBER_TYPE)) {
				tooltip.add(
					Text.translatable("item.minecraft.firework_rocket.flight")
						.append(ScreenTexts.SPACE)
						.append(String.valueOf(nbtCompound.getByte("Flight")))
						.formatted(Formatting.GRAY)
				);
			}
. . .
		}
	}

This has been fixed in 24w09a. I attached two videos: one demonstrating a fixed version, the other demonstrating a bugged version.

Dallin Gardner

(Unassigned)

Community Consensus

Gameplay

Normal

Items

1.18.1, 1.20.3 Pre-Release 2

24w09a

Retrieved