Skip to content

Particle Projectile Spell

JasperLorelai edited this page May 19, 2024 · 32 revisions

Source Code

spell-class: ".instant.ParticleProjectileSpell"
Value Supported
entity true
location true
entity_from_location true
  • delayed - Plays the effect at the projectile's location when the spell ends.
  • special - Plays the effect at the projectile's location during flight, every special-effect-interval.
  • projectile - Plays the effect at the projectile's position as it travels, every tick-interval. On this spell, this position only works for EffectLib effects, entity effects, and armorstand effects.

Description:

Fires a projectile that aims to hit a target with spells. You can configure it to have effects.

Configuration:

Since 4.0 Beta 13 some of these options support dynamic values through numeric or string expressions.

Option Description Type Default Supports expressions
start-forward-offset Modifies the forward offset. (Overrides start-x-offset) Float 1 true
start-x-offset Modifies the start x offset. Float 1 true
start-y-offset Modifies the start y offset. Float 0 true
start-z-offset Modifies the start z offset. Float 0 true
target-y-offset Modifies the target's y offset. Float 0 true
relative-offset Relative offset applied at the start location. (Overrides all options above) Vector "1,1,0" true
effect-offset Effect offset applied at the projectile location. Vector "0,0,0" true
projectile-acceleration Increases the projectile's speed over time. Float 0 true
projectile-acceleration-delay How often should it increase the projectile's speed? (in ticks). Integer 0 true
projectile-turn Rotates the projectile around this angle each tick it flies (forms a circle) Float 0 true
projectile-velocity How fast the projectile moves, roughly in blocks per second. Float 10 true
projectile-vert-offset An offset of the direction the projectile moves vertically in tangent values. Float 0 true
projectile-horiz-offset An offset of the direction the projectile moves horizontally in degrees. Float 0 true
projectile-gravity How fast the projectile falls, roughly in blocks per second. Float 0 true
projectile-vert-gravity How fast the projectile falls, roughly in blocks per second. (overrides projectile-gravity) Float 0 true
projectile-horiz-gravity Applies gravity affecting its horizontal rotation (forms a spiral) Float 0 true
projectile-spread Effectively the opposite of accuracy. A higher number means less accuracy. Float 0 true
projectile-vertical-spread Effectively the opposite of vertical accuracy. A higher number means less accuracy. (overrides projectile-spread) Float 0 true
projectile-horizontal-spread Effectively the opposite of horizontal accuracy. A higher number means less accuracy. (overrides projectile-spread) Float 0 true
tick-interval Defines how often in ticks the projectile moves to check modifiers, hitboxes, play effects, etc. Integer 2 true
spell-interval Used with the hit-air-during option, casts the spell-on-tick on each spell-interval. Note that one interval of this runs every tick-interval * spell-interval ticks. Integer 20 true
intermediate-effects How often to play the particle effects between travelled locations Integer 0 true
intermediate-hitboxes How often to check hitboxes between travelled locations. Since 4.0 Beta 14 this also checks ground collisions. Integer 0 true
ignore-passable-blocks Since 4.0 Beta 14. Sets if the projectile ignores passable blocks. Boolean true true
fluid-collision-mode Since 4.0 Beta 14. Sets how the projectile interacts with fluids. FluidCollisionMode "never" true
special-effect-interval How often to play the particle effects. Note that one interval of this runs every tick-interval * special-effect-interval ticks. Integer 1 true
max-distance The maximum distance this particle is allowed to travel away from the start location. Double 15 true
max-duration The maximum duration this projectile is allowed to exist. Double 0 true
hit-radius How far from the center of the projectile to look for entities to hit. Float 1.5 true
vertical-hit-radius How far vertically from the center of the particle to look for entities to hit. Float 1.5 true
ground-hit-radius How far from the center of the particle to look for ground blocks. Float 0 true
ground-vertical-hit-radius How far vertically from the center of the particle to look for ground blocks. Float 0 true
ground-materials A list of block materials, defined ground blocks for the projectile. String List Pathable blocks false
disallowed-ground-materials The ground blocks the projectile should ignore. You can use this to override some blocks in the default path-able list. String List false
tick-spell-limit How many times can the spell-on-tick be casted? Works only if the value is more than 0 Integer 0 true
max-entities-hit How many targets can it hit before it disappears? Integer 0 true
max-height-check Since 4.0 Beta 13. Checks how far above the projectile can be when hug-surface is set to true. This option does the check as the projectile travels. Integer 10 true
start-height-check Since 4.0 Beta 13. Checks how far above the projectile can be when hug-surface is set to true. This option does the check only when you cast the projectile. Integer 10 true
height-from-surface If hug-surface is true, this controls how high off the ground the projectile is. Float 0.6 true
hug-surface Whether this projectile should hug the surface rather than follow an arc. If this is true, the projectile-gravity will be ignored. Boolean false true
controllable If set to true, the projectile will follow your cursor's direction Boolean false true
change-pitch If set to false, the projectile's start location will set its pitch to 0 Boolean true true
hit-self Whether the projectile should hit the caster. Boolean false false
hit-ground Whether the projectile should trigger the spell upon running into the ground. Boolean true true
hit-players Whether the projectile should hit players. Boolean false false
hit-non-players Whether the projectile should hit non-players. Boolean true false
hit-air-at-end Whether the projectile should trigger the spell if it reaches max-distance without hitting anything. Boolean false true
hit-air-during Whether the projectile should trigger the spell all the way it travels. Boolean false true
hit-air-after-duration Whether the projectile should trigger the spell if it reaches max-duration without hitting anything. Boolean false true
stop-on-hit-entity Whether the projectile should stop upon hitting an entity. If this is false, it will continue through and could hit multiple targets. Boolean true true
stop-on-hit-ground Whether the projectile should stop upon hitting the ground. If this is false, it will pass through the ground and will not stop unless max-distance or max-duration is set Boolean true true
stop-on-modifier-fail Whether the projectile should disappear if projectile-modifiers will fail Boolean true true
allow-caster-interact Whether the caster can create interactions without other players. Boolean true true
power-affects-velocity Whether the spell power affects the velocity of the projectile. Boolean true true
can-target Target list for the projectile. (overrides hit-self, hit-players, hit-non-players) String List true
projectile-modifiers Modifiers for the projectile, if the modifier check won't pass, the projectile will stop flying. String List false
interactions Interactions define what happens when this projectile collides with another. Projectile Interaction List false
spell The default sub-spell to cast on hit. It must be a targeted spell that can hit the ground or an entity, depending on how the options above are set up. String false
spell-on-hit-air Sub-spell to cast when it reaches max distance. It must be a targeted spell that can hit the ground or an entity, depending on how the options above are set up. (requires hit-air-at-end) String false
spell-on-hit-self Sub-spell to cast when the projectile hits the caster. It must be a targeted spell that can hit the ground or an entity, depending on how the options above are set up. (requires hit-self) String false
spell-on-tick Sub-spell to cast when the projectile flies. It must be a targeted spell that can hit the ground, depending on how the options above are set up. (requires hit-air-during and spell-interval) String false
spell-on-hit-ground Sub-spell to cast when the projectile hits the ground. It must be a targeted spell that can hit the ground, depending on how the options above are set up. (requires hit-ground) String false
spell-on-hit-entity Sub-spell to cast when the projectile hits a target. It must be a targeted spell that can hit the ground or an entity, depending on how the options above are set up. (requires hit-players or hit-non-players or can-target list) String false
spell-on-duration-end Sub-spell to cast when the projectile reaches its max-duration. It must be a targeted spell that can hit the ground, depending on how the options above are set up. (requires hit-air-after-duration) String false
spell-on-modifier-fail Sub-spell to cast when the projectile's modifier list fails. It must be a targeted spell that can hit the ground, depending on how the options above are set up. (requires projectile-modifiers) String false
spell-on-entity-location Sub-spell to cast when the projectile hits a target. It must be a targeted spell that can hit the ground. String false

Example:

proj_test:
    spell-class: ".instant.ParticleProjectileSpell"
    change-pitch: true
    controllable: false
    projectile-velocity: 10
    tick-interval: 1
    max-distance: 40
    special-effect-interval: 1
    stop-on-hit-entity: false
    stop-on-hit-ground: true
    relative-offset: 0,1,0
    effects:
        eff1:
            position: special
            effect: particles
            particle-name: REDSTONE
            color: FFFF00
            horiz-spread: 0.1
            vert-spread: 0.1
            size: 1
            count: 25
Clone this wiki locally