Skip to content

Build Spell

MomoPewpew edited this page Jul 28, 2023 · 8 revisions

Source Code

spell-class: ".targeted.BuildSpell"

Description:

Targeted location spell that allows a player to build blocks from a distance, using blocks from a configurable location in their inventory (the first hotbar slot by default).

Configuration:

Option Description Default Value
slot The slot to use to build blocks. 0
consume-block Whether to use up the blocks in the defined slot. true
check-plugins Whether to check plugins for block build permissions. true
show-effect Whether to use the block-breaking effect as a spell animation. true
allowed-types The block types that can be built with this spell, as a comma-separated list of block materials. grass_block,stone,dirt
str-cant-build Message that appears when a player can't build, either because a plugin blocks it or because there is no target. You can't build there.
str-invalid-block Message that appears when a player tries to build a block that isn't in the allowed list. You can't build that block.

Example:

build:
    spell-class: ".targeted.BuildSpell"
    name: build
    cooldown: 2
    cast-item: stick
    description: Build blocks from far away.
    range: 25
    slot: 0
    consume-block: true
    check-plugins: true
    allowed-types:
        - grass_block
        - stone
        - dirt
    cost:
        - mana 5
    str-cost: 5 mana
    str-invalid-block: You can't build that block.
    str-cant-build: You can't build there.
Clone this wiki locally