Skip to content

Spell Configuration

Multitallented edited this page Sep 13, 2020 · 8 revisions

List of Spell Targets

Nearby

nearby1: # name of the target section (can be anything)
  type: nearby # get all targets within a radius of you or the block you're looking at if non-zero range
  cancel-if-empty: true
  radius: 9
  range: 0
  max-targets: 1 # only get the first target found. Defaults to get all targets found
  cancel-if-empty: false # does not prevent the components of the spell from being executed if there are no targets found

Vector

vector1:
  type: vector # draw a line in the direction you're looking. Targets any players/mobs on that line
  range: 20
  penetration: true # should it be able to go through blocks
  allow-multiple: false # should it stop when it gets the first target, or keep going
  cancel-if-empty: true # should it not execute the components of this section if no targets found

Block

block1:
  type: block # targets the block you're looking at, or the block at the coordinates
  x: "Math.abs($teleport#x$ - $teleport^1#x$) / 2" # gets the value half way between variable $teleport#x$ and $teleport^1#x$
  y: "Math.abs($teleport#y$ - $teleport^1#y$) / 2"
  z: "Math.abs($teleport#z$ - $teleport^1#z$) / 2"

List of Spell Components

Damage

Can be used as a condition or component. If used as a condition, it will check if the target can receive that much damage

damage: # does not do knockback, but does hit them as if you punched them
  target: vector1 # defaults to self
  ignore-armor: true # should be reduced by armor
  damage: 6

damage: 6 # deals 6 damage to yourself

Mana

Can be used as a condition or component. If used as a condition it will check if the target has that much mana

mana:
  target: nearby1
  mana: 10 # gives targets from the nearby1 section 10 mana

mana: 25 # gives yourself 25 mana

Cooldown

Can be used as a condition or component. If used as a condition, it will check if the target is on cooldown for that many seconds

cooldown:
  target: nearby1
  ability: "smack" 
  cooldown: 0 # sets the cooldown for the smack spell to 0 for all targets in the nearby1 section

cooldown: 12000 # set cooldown for 12s

Full Spell Config

icon: GOLDEN_CARROT # spell icon
type: spell
is-in-shop: false # should they have to unlock it with pre-reqs or buy it from the shop
level: 1
groups:
  - chase

pre-reqs: # same system as regions, towns, classes, etc.
  - skill:potion=7 # requires potion skill level 7

allowed-actions:
  - INVISIBILITY.99 # allows the player to hold/use items that have potion effect invisibility up to level 99

exp-per-use: 15 # gives them 15 exp for this spell each time they use it

conditions:
  cooldown: 120000 # must not be on 120s cooldown in order to use
  mana: 50 # must have 50 mana to use

components:
  1: # section 1
    yield: # outcome of the section
      mana: "-50 + $level$ + $rand$ * 10" # lose 50 mana - the spell level, - a random number between 0 and 10
      cooldown: 120000 # spell goes on cooldown for 120s
      sound: BLOCK_BREWING_STAND_BREW
      item:
        item: SPLASH_POTION # gives this item
        potion:
          type: INVISIBILITY
          upgraded: false
          extended: true
  2: # section 2
    variables:
      power^1: "0" # creates a variable named $power^1#var$
    yield:
      cooldown: 55000
      mana: -30
      duration: # creates a repeating section
        ticks: 150 # lasts for 7.5s (20 ticks per second)
        period: 40 # repeats every 2s
        delay: 40 # doesn't start until after 2s
        section:
          targets: # gets targets (mobs or players) for the spell
            nearby1: # get targets nearby
              cancel-if-empty: true # if no targets found, then do not execute any of the components in this section
              radius: 9 # gets all targets other than the caster within 9 blocks
              range: 10 # targets the block you're looking at up to 10 blocks away
              max-targets: 1 # will only get 1 target
          components:
            2:
              variables:
                power^1: "$power^1#var$ + 1" # increases the power variable by 1
              yield:
                particle^1:
                  target: nearby1 # the target selected from the nearby1 section
                  pattern: waves
                  particle: REDSTONE
                  red: 115
                  green: 3
                  blue: 252
                  duration: 2000 # 2s
                particle^2: # target defaults to the caster (self)
                  pattern: falling aura
                  particle: PORTAL
                  duration: 2000
                potion^1:
                  target: nearby1
                  type: WEAKNESS
                  level: "$power^1#var$"
                  ticks: 40
                potion^2:
                  type: INCREASE_DAMAGE
                  level: "$power^1#var$"
                  ticks: 40