Denizen Script Commands


Commands are always written with a '-' before them, and are the core component of any script, the primary way to cause things to happen.
Learn about how commands work in The Beginner's Guide.


Showing 1 out of 184 commands...
NameShoot
Syntaxshoot [<entity>|...] (origin:<entity>/<location>) (destination:<location>) (height:<#.#>) (speed:<#.#>) (script:<name>) (def:<element>|...) (shooter:<entity>) (spread:<#.#>) (lead:<location>) (no_rotate)
Short DescriptionShoots an entity through the air, useful for things like firing arrows.
Full DescriptionShoots an entity through the air up to a certain height, optionally triggering a script on impact with a target.

The launch has three modes: arc, lead, and direct.

The "arc" mode calculates a launch arc to exactly hit the target location.
If you want to use this, specify the "height" argument as how high the arc should go, in blocks.
Do not specify "speed" or "lead".
You can optionally specify a custom "gravity" (hidden from syntax line intentionally) if you know what you're doing and really need to.

The "lead" mode calculates a modified arc intended to hit a target based on a lead factor (usually the entity's velocity).
To use, specify the "lead" argument as a vector and "speed" as a launch speed.
Do not specify "height".

Generally, most users should prefer direct mode: it just launches straight in the direction of the destination, at the speed you specify.
To use this, just input the "speed" argument, and don't specify "height" or "lead".

If the origin is not an entity, you can specify a "shooter" so the damage handling code knows who to assume shot the projectile.

Normally, a list of entities will spawn mounted on top of each other. To have them instead fire separately and spread out,
specify the "spread" argument with a decimal number indicating how wide to spread the entities.

Optionally, add "no_rotate" to prevent the shoot command from rotating launched entities.

Use the "script:<name>" argument to run a task script when the projectiles land.
When that script runs, the following definitions will be available:
<[shot_entities]> for all shot entities (as in, the projectiles),
<[last_entity]> for the last one (The controlling entity),
<[location]> for the last known location of the last shot entity, and
<[hit_entities]> for a list of any entities that were hit by fired projectiles.

The shoot command is ~waitable. Refer to Language:~waitable.

Note that for ~waiting or the "script" arg, tracking is only accurate for projectile entities (such as arrows). This will be inaccurately estimated for other entity types.
Related Tags<entry[saveName].shot_entity> returns the single entity that was shot (as in, the projectile) (if you only shot one).
<entry[saveName].shot_entities> returns a ListTag of entities that were shot (as in, the projectiles).
<entry[saveName].hit_entities> returns a ListTag of entities that were hit (if any). (Only works when you ~wait for the command).
<entry[saveName].location> returns the last known location of the last shot entity. (Only works when you ~wait for the command).
Usage Example
# Use to shoot an arrow from the NPC to perfectly hit the player.
- shoot arrow origin:<npc> destination:<player.location>
Usage Example
# Use to shoot an arrow out of the player with a given speed.
- shoot arrow origin:<player> speed:2
Synonyms (Search Aid)launch
Groupentity
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/ShootCommand.java#L52