Skip to content
JasperLorelai edited this page May 19, 2024 · 18 revisions

Source Code

spell-class: ".instant.BlockBeamSpell"
Value Supported
entity true
location true
entity_from_location true
  • 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 shoots in a line that travels instantly to its end destination, using a block effect.

Configuration:

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

Option Description Type Default Supports expressions
block-type Item used in the beam. Magic Item String "stone" false
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.
remove-delay Delay before removing the blocks Integer 40 true
health Health of each block Double 2000 true
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
gravity How fast the beam falls, roughly in blocks per travelled distance. Float 0 true
y-offset Starting position of the beam according to the caster's location. (Overrides relative-offset) Float 0 true
interval Defines how often it will 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
rotation-x Rotation of the beam around its x-axis Float 0 true
rotation-y Rotation of the beam around its y-axis Flaot 0 true
rotation-z Rotation of the beam around its z-axis 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
small Whether the blocks should be smaller. Boolean false true
use-hp-fix Whether to use the hp fix. Boolean false 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 false
spell-on-end Sub-spell cast on beam's end position. String false
spell-on-hit-ground Sub-spell cast when the beam hits the ground. String false

Example:

Tree_Beam:
    spell-class: ".MultiSpell"
    name: "&2Tree &aBeam"
    spells:
        - Branch_Beam_1
        - Branch_Beam_2
        - Branch_Beam_3
        - Branch_Beam_4
        - Branch_Beam_5
    effects:
        1:
            position: caster
            effect: sound
            sound: block.grass.break
            volume: 5
            pitch: 0.5

Branch_Beam_1: &Branches
    spell-class: ".instant.BlockBeamSpell"
    helper-spell: true
    spell: Branch_Damage
    spell-on-hit-ground: Tree_Ground_Effect
    block-type: oak_wood
    change-pitch: false 
    stop-on-hit-ground: false 
    stop-on-hit-entity: false 
    health: 100
    use-hp-fix: false 
    target-relative-offset: 0,0,0
    beam-vert-offset: 0
    beam-horiz-offset: 0
    hit-radius: 1
    vertical-hit-radius: 2
    max-distance: 3
    remove-delay: 20
    rotation-x: 0
    rotation-y: 0
    rotation-z: 0
    interval: 0.5
    small: false
    rotation: 15
    gravity: -0.1
    relative-offset: 0,0.5,0
    
Branch_Beam_2:
    <<: *Branches
    spell-class: ".instant.BlockBeamSpell"
    rotation: -15
    gravity: -0.1
    beam-horiz-offset: 45
    relative-offset: 2.5,2,-0.5
    
Branch_Beam_3:
    <<: *Branches
    spell-class: ".instant.BlockBeamSpell"
    spell-on-end: Leaves_Beam_MULTI
    rotation: -15
    gravity: -0.1
    beam-horiz-offset: 45
    relative-offset: 4.5, 3.5, -2

Branch_Beam_4:
    <<: *Branches
    spell-class: ".instant.BlockBeamSpell"
    spell-on-end: Leaves_Beam_MULTI
    small: true
    rotation: -15
    gravity: -0.1
    beam-horiz-offset: 90
    relative-offset: 2, 3.5, -5
    
Branch_Beam_5:
    <<: *Branches
    spell-class: ".instant.BlockBeamSpell"
    spell-on-end: Leaves_Beam_MULTI
    small: true
    rotation: 15
    gravity: -0.1
    beam-horiz-offset: -90
    relative-offset: -2.5, 4.5, 7

Leaves_Beam_MULTI:
    spell-class: ".TargetedMultiSpell"
    helper-spell: true
    stop-on-fail: false
    require-entity-target: false
    spells:
        - Leaves_Beam_1
        - Leaves_Beam_2
        - Leaves_Beam_3
        - Leaves_Beam_4
        - Leaves_Beam_5
        - Leaves_Beam_6
        - Leaves_Beam_7

Leaves_Beam_1: &Leaves 
    spell-class: ".instant.BlockBeamSpell"
    helper-spell: true
    spell: Leaf_Damage
    block-type: oak_leaves
    change-pitch: false
    stop-on-hit-ground: false
    stop-on-hit-entity: false
    health: 100
    use-hp-fix: true 
    target-relative-offset: 0,0,0
    beam-vert-offset: 0
    hit-radius: 1
    vertical-hit-radius: 2
    gravity: 0
    beam-horiz-offset: -90
    interval: 0.5
    remove-delay: 20
    rotation-x: 0
    rotation-y: 0
    rotation-z: 0
    small: false
    max-distance: 6
    rotation: 30
    relative-offset: 0,0.5,0
    
Leaves_Beam_2:
    <<: *Leaves
    spell-class: ".instant.BlockBeamSpell"
    small: true
    rotation: 30
    max-distance: 6
    relative-offset: 0,1,0
    
Leaves_Beam_3:
    <<: *Leaves
    spell-class: ".instant.BlockBeamSpell"
    small: true
    rotation: 30
    max-distance: 6
    relative-offset: 0,0,0
 
Leaves_Beam_4:
    <<: *Leaves
    spell-class: ".instant.BlockBeamSpell"
    small: true
    rotation: 45
    max-distance: 4
    relative-offset: 0,1.4,0.3

Leaves_Beam_5:
    <<: *Leaves
    spell-class: ".instant.BlockBeamSpell"
    small: true
    rotation: 45
    max-distance: 4
    relative-offset: 0,-0.4,0.3

Leaves_Beam_6:
    <<: *Leaves
    spell-class: ".instant.BlockBeamSpell"
    small: true
    rotation: 90
    max-distance: 2
    relative-offset: 0,1.8,0.5

Leaves_Beam_7:
    <<: *Leaves
    spell-class: ".instant.BlockBeamSpell"
    small: true
    rotation: 90
    max-distance: 2
    relative-offset: 0,-0.8,0.5

Branch_Damage:
    spell-class: ".targeted.PainSpell"
    helper-spell: true
    damage: 4
    check-plugins: true
    ignore-armor: false
    can-target: players,nonplayers
    effects:
        1:
            position: target
            effect: particles
            particle-name: BLOCK_CRACK
            material: OAK_WOOD
            height-offset: 1
            horiz-spread: 1
            vert-spread: 1
            count: 10

Leaf_Damage:
    spell-class: ".targeted.PainSpell"
    helper-spell: true
    damage: 2
    check-plugins: true
    ignore-armor: false
    can-target: players,nonplayers
    effects:
        1:
            position: target
            effect: particles
            particle-name: BLOCK_CRACK
            material: OAK_LEAVES
            height-offset: 1
            horiz-spread: 1
            vert-spread: 1
            count: 20

Tree_Ground_Effect:
    spell-class: ".targeted.DummySpell"
    helper-spell: true
    effects:
        1:
            position: target
            effect: particles
            particle-name: EXPLOSION_NORMAL
            horiz-spread: 1
            vert-spread: 1
            count: 10
            speed: 0.25
Clone this wiki locally