Skip to main content

Module firework

Module firework 

Source
Expand description

A firework’s surface, and every game fact it is built on, in one file (spec-0068).

§Why the constants are here and not spread through the emitter

Each number below is read off a page of the Minecraft Wiki rather than measured on a server, and a cited number that is copied to its three call sites is three numbers a re-pin has to find. So the pages are named (WIKI_PAGES), each constant says which one it came from, and the emitter, the refusal and the skill page all read them from here: re-pinning the firework against a later game is one diff in this file.

The rules built on the facts — the fixed LifeTime, the roof column, the five-block reach — are authored, and they live with the check that states them.

Structs§

FireworkExplosion
One burst of a crate::Verb::Firework — one firework star.

Enums§

FireworkShape
One of the game’s five explosion shapes [cited — Data component format/fireworks], spelled as the component spells it.

Constants§

BLAST_RADIUS
How far a burst reaches, in blocks [cited — Firework Rocket].
BURST_HEIGHTS
The burst height in blocks above the launch cell, per flight duration 1, 2, 3 — the floor of each range the wiki states (8–20, 18–34, 32–52), because lifetime_ticks fixes LifeTime at the range’s floor [cited — Firework Rocket].
DAMAGE_ONE_STAR_HP
Damage a one-star burst deals, in HP, to a body within BLAST_RADIUS blocks and not behind a solid block [cited — Firework Rocket].
DAMAGE_PER_EXTRA_STAR_HP
Additional HP per star beyond the first [cited — Firework Rocket].
FIREWORKS_COMPONENT
The item component that holds the bursts [cited — Data component format/fireworks].
ITEM_FIELD
The entity’s item field [cited — Firework Rocket, entity data]. The summoned rocket reads its bursts from the stack under this key; a renamed key would ship a rocket that flies and shows nothing, so the emitted spelling is asserted against this constant by the emission test.
LIFETIME_STEP_TICKS
The fixed term of the game’s randomised LifeTime ((flight + 1) × LIFETIME_STEP_TICKS + random(0..5) + random(0..6) ticks) [cited — Firework Rocket, entity data].
MAX_EXPLOSIONS
At most seven bursts — the game’s own crafting cap, and the largest count the page states a damage for [cited — Firework Rocket]. The component would take 256; a display of more is a sequence of rockets, not one rocket that could kill an unhurt player by itself.
MAX_FLIGHT
The longest flight the game crafts [cited — Firework Rocket]. Durations beyond it are a non-goal: the wiki states a burst height for one, two and three, and for nothing else.
MIN_EXPLOSIONS
At least one burst: a rocket with none is a flare that glides along whatever it meets and shows nothing [cited — Firework Rocket].
MIN_FLIGHT
The shortest flight the game crafts, and this verb’s default.
ROCKET_ENTITY
The vanilla entity a firework effect summons.
ROCKET_ITEM
The item id the summoned rocket’s own item stack carries.
WIKI_PAGES
The wiki pages every constant in this module was read from (spec-0068 Ground). Named so a re-pin knows what to re-read, and asserted by crates/dsl/tests/v29_firework.rs so the list cannot quietly shrink.

Functions§

burst_height
The burst height for a flight duration, clamped to the crafted range.
lifetime_ticks
The LifeTime the emitter writes: the floor of the game’s randomised range, (flight + 1) × 10 ticks.
worst_damage_hp
The worst burst this verb can write, in HP: MAX_EXPLOSIONS stars.