ItemProjectileSpell - TheComputerGeek2/MagicSpells GitHub Wiki
spell-class: ".instant.ItemProjectileSpell"
targeting cast argument values:
| Value | Supported | 
|---|---|
entity | 
false | 
location | 
true | 
entity_from_location | 
false | 
Spell Effect Positions:
delayed- Plays the effect at the projectile's location when the spell ends.special- Plays the effect at the projectile's location during flight, everyspecial-effect-interval.projectile- Plays the effect at the projectile's position.casterprojectile- Plays the effect from the caster towards the projectile's location.
Description:
A spell throws an item like a projectile, for example, throwing a block of ice as a projectile.
Configuration:
Since 4.0 Beta 13 some of these options support dynamic values through numeric or string expressions.
| Option | Description | Type | Default | Support expressions | 
|---|---|---|---|---|
item | 
Type of the item. | Magic Item String | "iron_sword" | 
true | 
spell-delay | 
Delay before casting the spell-on-delay. | Integer | 40 | 
true | 
pickup-delay | 
Delay before entities can pick up the item. | Integer | 100 | 
true | 
remove-delay | 
Delay before the item is removed. | Integer | 100 | 
|
tick-interval | 
Defines (in server ticks) how often the projectile ticks to check hitboxes, play effects, etc. | Integer | 1 | 
true | 
spell-interval | 
Interval between casting spell-on-tick. Note that this interval is every tick-interval * spell-interval ticks. | 
Integer | 2 | 
true | 
item-name-delay | 
Delay before applying the name to the item. | Integer | 10 | 
true | 
special-effect-interval | 
Interval between playing special Spell Effects. Note that this interval is every tick-interval * special-effect-interval ticks. | 
Integer | 2 | 
true | 
speed | 
Speed the projectile launches at. | Float | 1 | 
true | 
y-offset | 
From what y coordinate, relative to the caster, the projectile launches from. | Float | 0 | 
true | 
hit-radius | 
The hit-radius of the projectile. | Float | 1 | 
true | 
vert-speed | 
How fast upwards the projectile is launched. | Float | 0 | 
true | 
vertical-hit-radius | 
The vertical-hit-radius of the projectile. | Float | 1.5 | 
true | 
rotation-offset | 
Turns the start location around a specified angle. | Float | 0 | 
true | 
stop-on-hit-ground | 
Whether the projectile should stop when it hits the ground. | Boolean | true | 
true | 
gravity | 
Whether or not the item eventually falls to the ground. | Boolean | true | 
true | 
relative-offset | 
Relative offset applied at the start location. | Vector | "0,0,0" | 
true | 
item-name | 
Name of the item. | Rich Text | true | 
|
spell-on-tick | 
Sub-spell to cast when the projectile continues flying. | String | false | 
|
spell-on-delay | 
Sub-spell to cast after a delay. | String | false | 
|
spell-on-hit-entity | 
Sub-spell to cast when the projectile hits an entity. | String | false | 
|
spell-on-hit-ground | 
Sub-spell to cast when the projectile hits ground. | String | false | 
Example:
itemprojectilepainspell:
    spell-class: ".targeted.PainSpell"
    range: 5
    damage: 6
itemprojectilefailspell:
    spell-class: ".instant.DummySpell"  
itemprojectilespell:
    spell-class: ".instant.ItemProjectileSpell"
    speed: 1
    vert-speed: 0 
    hit-radius: 1
    y-offset: 0
    spell-on-hit-entity: itemprojectilepainspell
    spell-on-hit-ground: itemprojectilefailspell
    item: iron_sword