Alpha: this compiler is under active development and updates will break your projects. Not recommended for real use yet.
Skip to content

spool / LaunchOptions

Interface: LaunchOptions โ€‹

Defined in: plugins/ballistics/launch.ts:19

Options for finding a launch that hits a target.

Flight time is the only free choice: for each time, the velocity that hits exactly is one division (see physics.ts). So the solver lists exact solutions and filters them by your constraints, rather than searching.

Whole ticks by default, so TNT with fuse = ticks explodes right on target.

Known differences from the game: no block collision, ground bounce or fluids; entities summoned mid-tick start moving next tick; TNT explodes 0.0625 above its feet; aim at feet; unloaded chunks don't tick; arrows fired by mobs get random spread.

Extended by โ€‹

Properties โ€‹

maxSpeed? โ€‹

readonly optional maxSpeed?: number

Defined in: plugins/ballistics/launch.ts:25

Reject faster solutions, in blocks/tick. Default 10, vanilla's Motion limit.


maxTicks? โ€‹

readonly optional maxTicks?: number

Defined in: plugins/ballistics/launch.ts:32

Latest flight time. Defaults to the projectile's fuse (80 for TNT), so it doesn't explode early.


minSpeed? โ€‹

readonly optional minSpeed?: number

Defined in: plugins/ballistics/launch.ts:23

Reject solutions slower than this, in blocks/tick. Default 0.


minTicks? โ€‹

readonly optional minTicks?: number

Defined in: plugins/ballistics/launch.ts:27

Earliest allowed flight time, in ticks. Default 1.


pitchRange? โ€‹

readonly optional pitchRange?: readonly [number, number]

Defined in: plugins/ballistics/launch.ts:37

Launch angle range in degrees, negative is up. [-90, -45] for a lob, [-20, 0] for a flat shot.


prefer? โ€‹

readonly optional prefer?: "min-speed" | "min-time" | "max-time"

Defined in: plugins/ballistics/launch.ts:44

Which exact solution to return:

  • "min-speed" (default): slowest shot that reaches.
  • "min-time": flattest and fastest.
  • "max-time": highest lob that fits; clears walls.

projectile? โ€‹

readonly optional projectile?: ProjectileProfile

Defined in: plugins/ballistics/launch.ts:21

Which entity to model. Default PROJECTILES.tnt.


subTickSamples? โ€‹

readonly optional subTickSamples?: number

Defined in: plugins/ballistics/launch.ts:49

Flight times tried per tick. Default 1. Raise for projectiles that must arrive between ticks.

Released under the MIT License ยท Credits
These docs were written with AI; the layout and every page have been reviewed by a human.