DrainlifeSpell - TheComputerGeek2/MagicSpells GitHub Wiki

Source Code

spell-class: ".targeted.DrainlifeSpell"

targeting cast argument values:

Value Supported
entity true
location false
entity_from_location false

Spell Effect Positions:

  • delayed - Plays the effect at the caster's location every animation tick.
  • special - Plays the effect at the caster's location at the current location of the animation every tick.

Description:

This spell is used to drain resources from the target.

Configuration:

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

Option Description Type Default Supports Expressions
take-type Defines what type is taken from the target. Drain Type "health" true
give-type Defines what type should be given to the caster. Drain Type "health" true
take-amt Amount to take from the target. Float 2 true
give-amt The amount to give to the caster. Float 2 true
power-affects-amount Since 4.0 Beta 13. Boolean true true
instant Defines if the caster should receive the effect instantly or wait until the animation brings them to the caster. Boolean true true
animation-speed The speed of the spell effect. A smaller number is faster. Integer 2 true
show-spell-effect Whether to show the animated smoke moving from target to caster. Boolean true true
spell-on-animation Sub-spell to cast when the animation reaches the caster. String false

Drain Types:

  • health:

    Option Description Type Default Supports Expressions
    damage-type Defines the damage cause of this spell. String "entity_attack" true
    check-plugins Whether to attempt to check other plugins for PvP restrictions. Boolean true true
    spell-damage-type This custom damage type can be used with the ResistSpell. String true
    avoid-damage-modification Defienes whether any spells shouldn't modify the damage amount of this spell. Boolean true true
    ignore-armor Ignores armor. Boolean true true
  • mana

  • hunger

  • experience

Example:

drainlife:
    spell-class: ".targeted.DrainlifeSpell"
    name: drainlife
    spell-icon: ghast_tear
    description: Drain life from your enemy and give it to you.
    cast-item: blaze_rod
    cooldown: 5
    range: 15
    take-type: health
    take-amt: 2
    give-type: health
    give-amt: 2
    animation-speed: 2
    ignore-armor: false
    instant: false
    can-target: players,monsters
    check-plugins: true
    cost:
        - mana 10
    str-cost: 10 mana
    str-cast-self: You drain life from your enemy.
    str-no-target: No target found.
    effects:
        eff1:
            position: special
            effect: particles
            height-offset: 1
            particle-name: redstone
            color: FF0000
            horiz-spread: 0.25
            vert-spread: 0.25
            count: 10