Skip to content

API reference / @jsprismarine/prismarine / entity/data/fireworkRockets / FireworkRockets

Class: FireworkRockets ​

Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:209

The firework rockets of one runtime, and the system that flies each of them once a tick.

Constructors ​

Constructor ​

new FireworkRockets(host): FireworkRockets

Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:216

Parameters ​

host ​

FireworkRocketsHost

Returns ​

FireworkRockets

Methods ​

forget() ​

forget(id): void

Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:311

Forgets what the system kept beside a rocket that left the store.

Parameters ​

id ​

number

Returns ​

void


launch() ​

launch(at, launch): DataEntity | undefined

Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:226

Sets a rocket off: Java's FireworkRocketEntity constructors, which draw its lifetime from its flight and its launch drift, and attach it to a glider when one set it off.

Parameters ​

at ​

EntityPosition

Where it starts.

launch ​

RocketLaunch

Returns ​

DataEntity | undefined

The rocket, or undefined when the content declares no firework rocket.

Java Source ​

FireworkRocketEntity.<init>(Lnet/minecraft/world/level/Level;DDDLnet/minecraft/world/item/ItemStack;)V


update() ​

update(entity): void

Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:266

One tick of a rocket, Java's FireworkRocketEntity.tick in its order: an attached rocket rides with its glider, a free one speeds up and moves, a hit ends it, the first tick plays the launch, and once its life passes its lifetime it explodes.

Parameters ​

entity ​

DataEntity

Returns ​

void

Java Source ​

FireworkRocketEntity.tick