Skip to content

Throw Block Spell

MomoPewpew edited this page Sep 28, 2024 · 10 revisions

Source Code

spell-class: ".instant.ThrowBlockSpell"

Description:

Instant spell. Throws a block of the given type (anvil by default), which turns into a regular block when it lands.

Configuration:

Option Description Default Value
block-type The type of block to throw. anvil
velocity The velocity of the thrown block. 1.0
y-offset The y-offset of the start location. 0
vertical-adjustment An adjustment to how high the block flies. 0.5
rotation-offset Which direction to throw the block, in degrees. A value of 0 is forward, 180 is backward, etc. 0
apply-spell-power-to-velocity Whether to apply the Spell Power for this spell to the velocity. false
gravity Whether gravity should be applied to the thrown block. true
drop-item Whether to drop an item if the block is unable to land properly. false
duration The duration in ticks after which the falling block (or the landed block) is removed. If this is greater than 0, the thrown block will also be removed on plugin reload. 0
prevent-blocks Completely prevents blocks from spawning. false
call-target-event Whether being hit by a falling block should count as being targeted by this spell. true
check-plugins Whether to attempt to alert other plugins that this damage is actually being caused by the casting player. false
ensure-spell-cast If this is true, the plugin will constantly monitor the thrown block to make sure the spell goes off. This may have a negative effect on performance, so if you don't need this feature you can turn it off. true
sticky-blocks If this is true, it will cause blocks to “stick” to walls, rather than hit them and fall down. false
spell-on-land Sub-spell to cast when the block lands. false

Example:

anvil:
    spell-class: ".instant.ThrowBlockSpell"
    name: anvil
    cooldown: 10
    cast-item: blaze_rod
    description: Throws an anvil.
    block-type: anvil
    velocity: 1.0
    rotation-offset: 0
    vertical-adjustment: 0.5
    drop-item: false
    remove-blocks: false
    call-target-event: true
    cost:
        - mana 25
        - anvil 1
    str-cost: 25 mana and 1 anvil
Clone this wiki locally