Build Spell - TheComputerGeek2/MagicSpells GitHub Wiki

Source Code

spell-class: ".targeted.BuildSpell"

targeting cast argument values:

Value Supported
entity false
location true
entity_from_location false

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:

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

Option Description Type Default Supports expressions
slot The slot to use to build blocks. Integer 0 true
consume-block Defines whether to use up the blocks in the defined slot. Boolean true true
check-plugins Defines whether to check plugins for block build permissions. Boolean true true
show-effect Defines whether to use the block-breaking effect as a spell animation. Boolean true true
allowed-types The block types that can be built with this spell. String List [grass_block, stone, dirt] false
str-cant-build Message that appears when a player can't build, either because a plugin blocks it or because there is no target. Rich Text "You can't build there." true
str-invalid-block Message that appears when a player tries to build a block that isn't in the allowed list. Rich Text "You can't build that block." true

Example:

build:
    spell-class: ".targeted.BuildSpell"
    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.