Wiki 9Minecraft Wiki 9Minecraft

How to Program Your First Projectile Spell

Launching a Spell Entity Along Your Sightline

Spell programming lets you chain individual logic, math, and action parts together to control a Spell Entity in the world. To build a projectile that flies where you aim, start by reading your look direction with Spell: Get View Vector. If you want to adjust projectile speed, combine digit parts (Spell: Number 0 through Spell: Number 9) using Spell: Multiplication, grouping operations inside Spell: Left Paren and Spell: Right Paren. Pass the resulting vector into Spell: Gain Velocity to propel the Spell Entity forward, and separate distinct steps in your program with Spell: Expression Separator.

Adding Impact Triggers and Debugging

Without a trigger, payload effects run immediately instead of waiting for impact. Follow your trigger with an action such as Spell: Apply Potion, Spell: Explosion, or Spell: Teleport (combining Spell: Get Caster Entity with Spell: Get Spell Entity Position), and finish cleanly with Spell: End Spell. Whenever a calculation behaves unexpectedly, insert Spell: Debug Print to inspect live outputs like Spell: Get Entity Velocity or Spell: Get Entity Health before spending full mana on combat casts.