Skip to content

Particle Projectile Spell

MomoPewpew edited this page Jul 28, 2023 · 22 revisions

Source Code

spell-class: ".instant.ParticleProjectileSpell"

Description:

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

Configuration:

Option Description Variable Type Default Value
start-forward-offset Modifies the forward offset. (Overrides start-x-offset) Float 1
start-x-offset Modifies the start x offset. Float 1
start-y-offset Modifies the start y offset. Float 0
start-z-offset Modifies the start z offset. Float 0
target-y-offset Modifies the target's y offset. Float 0
relative-offset Relative offset applied at the start location. (Overrides all options above) String "1,1,0"
effect-offset Effect offset applied at the projectile location. String "0,0,0"
projectile-acceleration Increases the projectile's speed over time. Float 0
projectile-acceleration-delay How often should it increase the projectile's speed? (in ticks). Integer 0
projectile-turn Rotates the projectile around this angle each tick it flies (forms a circle) Float 0
projectile-velocity How fast the projectile moves, roughly in blocks per second. Float 10
projectile-vert-offset An offset of the direction the projectile moves vertically in tangent values. Float 0
projectile-horiz-offset An offset of the direction the projectile moves horizontally in degrees. Float 0
projectile-gravity How fast the projectile falls, roughly in blocks per second. Float 0
projectile-vert-gravity How fast the projectile falls, roughly in blocks per second. (overrides projectile-gravity) Float 0
projectile-horiz-gravity Applies gravity affecting its horizontal rotation (forms a spiral) Float 0
projectile-spread Effectively the opposite of accuracy. A higher number means less accuracy. Float 0
projectile-vertical-spread Effectively the opposite of vertical accuracy. A higher number means less accuracy. (overrides projectile-spread) Float 0
projectile-horizontal-spread Effectively the opposite of horizontal accuracy. A higher number means less accuracy. (overrides projectile-spread) Float 0
tick-interval How often to play the particle effect and check hitboxes (in ticks) Integer 2
spell-interval Used with the hit-air-during option, casts the spell-on-tick each defined ticks Integer 20
intermediate-effects How often to play the particle effects between travelled locations Integer 0
intermediate-hitboxes How often to check hitboxes between travelled locations Integer 0
special-effect-interval How often to play the particle effects (in ticks) Integer 1
max-distance The maximum distance this particle is allowed to travel. Double 15
max-duration The maximum duration this particle is allowed to exist. Double 0
hit-radius How far from the center of the particle to look for entities to hit. Float 1.5
vertical-hit-radius How far vertically from the center of the particle to look for entities to hit. Float 1.5
ground-hit-radius How far from the center of the particle to look for ground blocks. Float 0
ground-vertical-hit-radius How far vertically from the center of the particle to look for ground blocks. Float 0
ground-materials A list of block materials, defined ground blocks for the projectile. String List null (path-able blocks by default)
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 null
tick-spell-limit How many times can the spell-on-tick be casted? Works only if the value is more than 0 Integer 0
max-entities-hit How many targets can it hit before it disappears. Integer 0
height-from-surface If hug-surface is true, this controls how high off the ground the projectile is. Float 0.6
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
controllable If set to true, the projectile will follow your cursor's direction Boolean false
change-pitch If set to false, the projectile's start location will set its pitch to 0 Boolean true
hit-self Whether the projectile should hit the caster. Boolean false
hit-ground Whether the projectile should trigger the spell upon running into the ground. Boolean true
hit-players Whether the projectile should hit players. Boolean false
hit-non-players Whether the projectile should hit non-players. Boolean true
hit-air-at-end Whether the projectile should trigger the spell if it reaches max-distance without hitting anything. Boolean false
hit-air-during Whether the projectile should trigger the spell all the way it travels. Boolean false
hit-air-after-duration Whether the projectile should trigger the spell if it reaches max-duration without hitting anything. Boolean false
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
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
stop-on-modifier-fail Whether the projectile should disappear if projectile-modifiers will fail Boolean true
allow-caster-interact Whether the caster can create interactions without other players Boolean true
power-affects-velocity Whether the spell power affects the velocity of the projectile. Boolean true
can-target Target list for the projectile. (overrides hit-self, hit-players, hit-non-players) String List null
projectile-modifiers Modifiers for the projectile, if modifier check won't pass, the projectile will stop flying. String List null
interactions Interaction list (- projectileToCollideWith spellOnCollision) String List null
spell The default sub-spell to cast on hit. Must be a targeted spell that can hit the ground or an entity, depending on how the options above are set up. String Empty
spell-on-hit-air Sub-spell to cast when it reaches max distance. 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 Empty
spell-on-hit-self Sub-spell to cast when the projectile hits the caster. 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 Empty
spell-on-tick Sub-spell to cast when the projectile flies. 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 Empty
spell-on-hit-ground Sub-spell to cast when the projectile hits the ground. Must be a targeted spell that can hit the ground, depending on how the options above are set up. (requires hit-ground) String Empty
spell-on-hit-entity Sub-spell to cast when the projectile hits a target. 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 Empty
spell-on-duration-end Sub-spell to cast when the projectile reaches its max-duration. 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 Empty
spell-on-modifier-fail Sub-spell to cast when the projectile's modifier list fails. Must be a targeted spell that can hit the ground, depending on how the options above are set up. (requires projectile-modifiers) String Empty
spell-on-entity-location Sub-spell to cast when the projectile hits a target. Must be a targeted spell that can hit the ground. String Empty

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