AreaEffectSpell - TheComputerGeek2/MagicSpells GitHub Wiki

Source Code

spell-class: ".targeted.AreaEffectSpell"

targeting cast argument values:

Value Supported
entity false
location true
entity_from_location false

Spell Effect Positions:

  • special - Plays the effect at the AOE's center start location once the AOE succeeds.

Description:

The 'Area of Effect' spell is used for converting or applying all spells listed in its string to an area defined and limited by its configuration options.

Configuration:

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

Option Description Type Default Supports expression
spells List of sub-spells to cast. String List false
max-targets Max targets for the AOE. 0 means no max. Integer 0 true
circle-shape Whether the horizontal radius of the AOE should be circular. Boolean false true
cone If point-blank is set to true, which it is by default, this will make the AOE a cone instead of it being 360 degrees around the caster. The best way to explain it is that it works like the sweep attack on swords. Value is specified in degrees. Double 0 true
horizontal-cone Since 4.0 Beta 13. Same as above, but this checks the horizontal cone instead. Double 0 true
vertical-radius Vertical hit radius for the AOE. Double 5 true
horizontal-radius Horizontal hit radius for the AOE. Double 10 true
min-horizontal-radius Since 4.0 Beta 14. Minimal horizontal hit radius for the AOE. Double 0 true
min-vertical-radius Since 4.0 Beta 14. Minimal vertical hit radius for the AOE. Double 0 true
use-proximity Defines if the AOE should select targets by proximity. This is only useful if you have defined max-targets. Boolean false true
ignore-radius Since 4.0 Beta 13. When true, it makes the AOE target all entities in all worlds instead of having a radius constraint. Use other options to limit the target list, including target-modifiers like usual. Boolean false true
reverse-proximity Defines reverse proximity, if use-proximity is enabled. This makes the AOE look for further away targets instead. Boolean false true
point-blank While set to true, when cast the start location of the AOE will be the caster's location. When it's set to false, the AOE center will be the block the caster pointed at while casting the spell. Boolean true true
fail-if-no-targets If set to false, if the AOE fails to find targets, it won't play any effects specified on it. Boolean true true
pass-targeting Defines whether or not to pass targeting list to sub spells or not. Boolean false true
spell-source-in-center If point-blank is set to false and this to true, it will attempt to make the source of all targeted spells the center of the AOE. For example, if the AOE casts a HomingMissileSpell, the missile will spawn in the center of the AOE. Boolean false true

Examples:

sweep:
    spell-class: ".targeted.AreaEffectSpell"
    cast-item: watch
    horizontal-radius: 5
    vertical-radius: 3
    cone: 45
    spells: [pain]
    effects:
        Sound:
            position: caster
            sound: entity.player.attack.sweep
        Particles:
            position: special
            effect: particles
            forward-offset: 1
            height-offset: 1
            particle-name: SWEEP_ATTACK
            horiz-spread: 1
            vert-spread: 1
            count: 10
            speed: 0
pain:
    spell-class: ".targeted.PainSpell"
    damage: 2
storm:
    spell-class: ".targeted.AreaEffectSpell"
    cast-item: paper
    horizontal-radius: 10
    vertical-radius: 10
    point-blank: false
    range: 200
    spells: [lightning]

lightning:
    spell-class: ".targeted.LightningSpell"
    no-damage: true