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§
- Firework
Explosion - One burst of a
crate::Verb::Firework— one firework star.
Enums§
- Firework
Shape - 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_ticksfixesLifeTimeat the range’s floor [cited — Firework Rocket]. - DAMAGE_
ONE_ STAR_ HP - Damage a one-star burst deals, in HP, to a body within
BLAST_RADIUSblocks 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
sequenceof 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.rsso the list cannot quietly shrink.
Functions§
- burst_
height - The burst height for a flight duration, clamped to the crafted range.
- lifetime_
ticks - The
LifeTimethe emitter writes: the floor of the game’s randomised range,(flight + 1) × 10ticks. - worst_
damage_ hp - The worst burst this verb can write, in HP:
MAX_EXPLOSIONSstars.