API reference / @jsprismarine/prismarine / entity/data/fireworkRockets
entity/data/fireworkRockets
Classes
Interfaces
FireworkRocketsHost
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:152
What FireworkRockets needs from the runtime and the server behind it.
Methods
boostGlider()
boostGlider(
id,ticks):void
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:169
Tells a glider's client how long the boost a rocket gives it lasts; the client flies it, as it moves its own player.
Parameters
id
number
ticks
number
Returns
void
byId()
byId(
id):DataEntity|undefined
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:162
An entity of the store, by runtime id.
Parameters
id
number
Returns
DataEntity | undefined
clear()
clear(
from,to):boolean
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:189
Whether a straight line between two points passes through no block that blocks movement.
Parameters
from
to
Returns
boolean
exploded()
exploded(
rocket):void
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:185
Shows a rocket's explosion to everyone who sees it: the burst of its stars, or a pop.
Parameters
rocket
Returns
void
hurt()
hurt(
target,amount,rocket):void
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:191
Deals a blast's damage to one entity, answerable to the rocket's owner.
Parameters
target
amount
number
rocket
Returns
void
isGliding()
isGliding(
id):boolean
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:164
Whether an entity glides on an elytra.
Parameters
id
number
Returns
boolean
launched()
launched(
rocket):void
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:183
Plays the launch at a rocket, as its first tick does.
Parameters
rocket
Returns
void
livingNear()
livingNear(
center,radius): readonlyDataEntity[]
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:187
The living entities whose feet are within radius of a point, players included.
Parameters
center
radius
number
Returns
readonly DataEntity[]
move()
move(
rocket,motion,moves,ignored):object
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:176
Finds what a rocket meets along motion from where it is, Java's ProjectileUtil.getHitResultOnMoveVector, and moves it there with block collision when moves, as Java's move does. ignored is never hit, which is the glider a rocket rides with.
Parameters
rocket
motion
moves
boolean
ignored
number | undefined
Returns
object
The first entity or block it meets, and whether its move scraped a wall.
hit
readonlyhit:RocketHit
horizontalCollision
readonlyhorizontalCollision:boolean
random()
random():
number
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:158
A number in [0, 1) from the world's random.
Returns
number
randomInt()
randomInt(
bound):number
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:160
A whole number in [0, bound) from the world's random.
Parameters
bound
number
Returns
number
remove()
remove(
id,reason):void
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:156
Takes an entity out of the store.
Parameters
id
number
reason
string
Returns
void
spawn()
spawn(
identifier,at,options):DataEntity|undefined
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:154
Creates one entity of the store, as EntityRuntime.spawn does.
Parameters
identifier
string
at
options
Returns
DataEntity | undefined
RocketLaunch
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:195
How one rocket starts.
Properties
attachedTo?
readonlyoptionalattachedTo?:number
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:201
The glider it rides along with, for a rocket set off while gliding.
fireworks?
readonlyoptionalfireworks?:Readonly<Record<string,unknown>>
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:197
The minecraft:fireworks of the stack the rocket was, or undefined for none.
owner?
readonlyoptionalowner?:number
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:199
The entity that set it off, which its blast is answerable to.
shotAtAngle?
readonlyoptionalshotAtAngle?:boolean
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:203
Whether it flies straight, as one a crossbow fires does.
velocity?
readonlyoptionalvelocity?:EntityPosition
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:205
Its velocity, for a rocket shot from a crossbow or a dispenser; a launch's own otherwise.
RocketTuning
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:54
The numbers of jsprismarine:fireworks_rocket.
Properties
acceleration
readonlyacceleration:number
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:64
What a free rocket's sideways speed is multiplied by each tick it does not scrape a wall.
blastRadius
readonlyblastRadius:number
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:72
How far a blast reaches, in blocks.
climb
readonlyclimb:number
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:66
What a free rocket's climb gains each tick.
damagePerExplosion
readonlydamagePerExplosion:number
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:70
The damage each explosion adds.
explosionDamage
readonlyexplosionDamage:number
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:68
The damage a blast deals before its explosions add theirs.
launchClimb
readonlylaunchClimb:number
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:62
A launch's climb, in blocks per tick.
launchSpread
readonlylaunchSpread:number
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:60
The spread of a launch's sideways drift, Java's triangle(0, 0.002297).
lifetimeSpread
readonlylifetimeSpread: readonly [number,number]
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:58
The two bounds Java draws extra ticks of flight below, nextInt(6) + nextInt(7).
ticksPerFlight
readonlyticksPerFlight:number
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:56
Ticks of flight each stage of flight_duration, and one more stage, give: Java's 10.
Type Aliases
RocketHit
RocketHit = {
id:number;kind:"entity"; } | {kind:"block"; } | {kind:"none"; }
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:148
What a rocket hit along the way it moved this tick.
Variables
FIREWORKS_ROCKET
constFIREWORKS_ROCKET:"minecraft:fireworks_rocket"='minecraft:fireworks_rocket'
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:28
The Bedrock type of every firework rocket in flight.
FIREWORKS_ROCKET_COMPONENT
constFIREWORKS_ROCKET_COMPONENT:"jsprismarine:fireworks_rocket"='jsprismarine:fireworks_rocket'
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:31
The host component that makes a data entity a firework rocket, and holds its tuning.
ROCKET_FIREWORKS
constROCKET_FIREWORKS:"minecraft:fireworks"='minecraft:fireworks'
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:34
The spawn data key the rocket's minecraft:fireworks is kept under.
rocketAttachment
constrocketAttachment:ComponentStateKey<ComponentStateShape<{entity: (value) =>value is number; }>>
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:47
The entity a rocket is attached to, by runtime id, which no save keeps.
rocketState
constrocketState:ComponentStateKey<ComponentStateShape<{life: (value) =>value is number;lifetime: (value) =>value is number;shotAtAngle: (value) =>value is boolean; }>>
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:40
One rocket's flight: ticks flown, the tick it explodes after, and whether it flies straight.
Functions
explosionCountOf()
explosionCountOf(
fireworks):number
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:132
How many explosions a rocket's minecraft:fireworks holds.
Parameters
fireworks
Readonly<Record<string, unknown>> | undefined
Returns
number
isFireworkRocket()
isFireworkRocket(
entity):boolean
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:117
Whether a data entity is a firework rocket this system runs.
Parameters
entity
Returns
boolean
rocketAttachedTo()
rocketAttachedTo(
entity):number|undefined
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:144
The entity a rocket rides along with, or undefined for a rocket that flies free.
Parameters
entity
Returns
number | undefined
rocketFireworksOf()
rocketFireworksOf(
spawnData):Readonly<Record<string,unknown>> |undefined
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:124
The minecraft:fireworks a rocket's spawn data carries, or undefined for a rocket made from no stack, as /summon makes one.
Parameters
spawnData
Readonly<Record<string, unknown>> | undefined
Returns
Readonly<Record<string, unknown>> | undefined
rocketTuningOf()
rocketTuningOf(
entity):RocketTuning
Defined in: packages/prismarine/src/entity/data/fireworkRockets.ts:82
The tuning a rocket's definition declares.
Parameters
entity
Returns
Throws
When the definition has no host component.
Throws
When it leaves a number out.