Skip to content

BlockBeamSpell

MomoPewpew edited this page Jul 28, 2023 · 15 revisions

Source Code

spell-class: ".instant.BlockBeamSpell"

Description:

Instant spell: A ranged mechanic which shoots in a line that travels instantly to its end destination, using a block effect.

Configuration:

Option Description Default Value
block-type Type of the block used in the spell. stone
relative-offset Modifies the start location of the beam by the defined vector. 0,0.5,0
target-relative-offset Modifies the entity target location of the beam by the defined vector. 0,0.5,0
remove-delay Delay before removing the blocks 40
health Health of each block 2000
hit-radius Radius around the beam that will be collided with. 2
max-distance Max distance it will travel before removal. 30
vertical-hit-radius Radius of the vertical collision. 2
gravity How fast the beam falls, roughly in blocks per travelled distance. 0
y-offset Starting position of the beam according to caster's location. (Overrides relative-offset) 0
interval How often it will play the spell's listed effects in ticks. 1
rotation Rotation of the beam over time and distance to the degree given. 0
rotation-x Rotation of the beam around its x-axis 0
rotation-y Rotation of the beam around its y-axis 0
rotation-z Rotation of the beam around its z-axis 0
beam-vert-offset Starting position vertically. 0
beam-horiz-offset Starting position horizontally. 0
small Whether the blocks should be smaller. false
use-hp-fix Whether to use the hp fix. false
change-pitch Whether to change start location's pitch. true
stop-on-hit-entity Should the beam stop itself when it hits an entity? false
stop-on-hit-ground Should the beam stop itself when it hits the ground? false
spell Sub-spell cast on hit. ""
spell-on-end Sub-spell cast on beam's end position. ""
spell-on-hit-ground Sub-spell cast when the beam hits the ground. ""

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