Launching and Steering a Spell Entity
Spell programming lets you chain individual spell parts into custom projectiles and world effects. When cast, projectile routines operate through a Spell Entity whose mana drain is calculated using physics-based mechanics, factoring in fixed cast mass and velocity. To propel your projectile forward along your crosshair, read your aim direction with Spell: Get View Vector, scale that vector if needed using Spell: Multiplication alongside Spell: Number 0 through Spell: Number 9, and apply motion with Spell: Gain Velocity. Separate distinct operations cleanly with Spell: Expression Separator so each step evaluates in order.
Adding Impact Triggers and Effects
A moving projectile needs a trigger to know when to fire its payload before closing with Spell: End Spell:
- Mining Projectiles: Pair Spell: Trigger on Touching Block with Spell: Mine Block or Spell: Break Block. Add Spell: Send To Inventory if you want harvested drops routed directly back to you. Keep in mind that breaking harder blocks costs more mana per point of hardness.
- Combat and Utility Projectiles: Pair Spell: Trigger on Touching Entity or block triggers with Spell: Apply Potion for status effects, Spell: Explosion for area damage, or Spell: Teleport (reading Spell: Get Spell Entity Position) to blink to where your projectile lands.
