BeamSpell - TheComputerGeek2/MagicSpells GitHub Wiki

Source Code

spell-class: ".instant.BeamSpell"

targeting cast argument values:

Value Supported
entity true
location true
entity_from_location true

Spell Effect Positions:

  • disabled - Plays the effect at the block the beam collided on.
  • delayed - Plays the effect at the block the beam collided on if it landed in a no-magic zone that fizzled the beam.
  • special - Plays the effect at the projectile's location as it flies per interval.

Description:

A ranged mechanic that shoots in a line that travels instantly to its end destination.

Configuration:

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

Option Description Type Default Supports expressions
relative-offset Modifies the start location of the beam by the defined vector. Vector 0,0.5,0 Depends on vector format.
target-relative-offset Modifies the entity target location of the beam by the defined vector. Vector 0,0.5,0 Depends on vector format.
hit-radius Radius around the beam that will be collided with. Double 2 true
max-distance Max distance it will travel before removal. Double 30 true
vertical-hit-radius Radius of the vertical collision. Double 2 true
vertical-rotation Since 4.0 Beta 13. Rotates the beam on the vertical axis constantly. Double 0 true
horizontal-rotation Since 4.0 Beta 13. Rotates the beam on the horizontal axis constantly. Double 0 true
y-offset Starting position of the beam according to the caster's location. (Overrides relative-offset) Double 0 true
gravity How fast the beam falls, roughly in blocks per travelled distance. Float 0 true
interval How often will it play the spell's listed effects in ticks? Float 1 true
rotation Rotation of the beam over time and distance to the degree given. Float 0 true
beam-vert-offset Starting position vertically. Float 0 true
beam-horiz-offset Starting position horizontally. Float 0 true
beam-spread Effectively the opposite of accuracy. A higher number means less accuracy. Float 0 true
beam-vertical-spread Effectively the opposite of vertical accuracy. A higher number means less accuracy. (overrides beam-spread) Float 0 true
beam-horizontal-spread Effectively the opposite of horizontal accuracy. A higher number means less accuracy. (overrides beam-spread) Float 0 true
change-pitch Whether to change the start location's pitch. Boolean true true
stop-on-hit-entity Should the beam stop itself when it hits an entity? Boolean false true
stop-on-hit-ground Should the beam stop itself when it hits the ground? Boolean false true
spell Sub-spell cast on hit. String float
spell-on-end Sub-spell cast on beam's end position. String float
spell-on-travel Sub-spell cast on each block along the beam's length String float
spell-on-hit-ground Sub-spell cast when the beam hits ground. String float
spell-on-entity-location Sub-spell to cast when the beam hits a target, firing at the location where the beam hits the entity. For example, if the beam hits the head of a zombie, the spell provided will be cast at the zombie's head. It must be a targeted spell that can hit the ground. String float

Example:

Fire_Beam:
    spell-class: ".instant.BeamSpell"
    name: "&cFire &6Beam&e"
    spell: Fire_Beam_Burn
    y-offset: 0
    max-distance: 15
    interval: 0.5
    effects:
        1:
            position: special
            effect: particles
            particle-name: redstone
            color: F0EA2D
            horiz-spread: 0.25
            vert-spread: 0.25           
            count: 20 
        2:
            position: special
            effect: particles
            particle-name: redstone
            color: F0B52D
            horiz-spread: 0.5
            vert-spread: 0.5
            count: 20 
        3:
            position: special
            effect: particles
            particle-name: redstone
            color: F0452D
            horiz-spread: 1
            vert-spread: 1
            count: 20 
        4:
            position: caster
            effect: sound
            sound: item.firecharge.use
            volume: 5
            pitch: 1.5
            
Fire_Beam_Burn:
    spell-class: ".targeted.CombustSpell"
    fire-ticks: 100
    fire-tick-damage: 1
    prevent-immunity: true
    target-players: true
    check-plugins: true
    effects:
        1:
            position: target
            effect: particles
            particle-name: SMOKE_LARGE
            height-offset: 1
            horiz-spread: 0.25
            vert-spread: 0.25          
            count: 20 
            speed: 0.1
        2:
            position: target
            effect: particles
            particle-name: FLAME
            height-offset: 1
            horiz-spread: 0.1
            vert-spread: 0.1          
            count: 20 
            speed: 0.1