Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Routine: Explode

1cec0ld edited this page Jul 26, 2012 · 7 revisions

Syntax: {entity}effect.explode

Description: Routine that generates an explosion at the location of the specified entity. The size of the explosion is calculated in the nested routines. Power = blocks affected * 10. NOTE: This will always kill the entity made to explode. If you want a nonlethal effect, try projectileeffect or another entity than the living target!

Examples:

Damage: #Make chickens unstable. Force players to hit them gently.
    - 'if target.type.Chicken and damage > 4':
        - 'targeteffect.explode': '30'  #affects a radius of 3 blocks
# This configuration overrides arrow behavior with attacking players that have the perm "magicarrows".
#   When hit by one of these players' arrows, the attacker is notified and a 10-second countdown initiates
#   until the target explodes violently. If the target is a player and there are 2 seconds left, a warning is broadcast
#   to the world they're in.
Aliases: 
    Routine:
        makeEmExplode:
            - 'if target.istagged.explosive':
                - 'if target_tagvalue_explosive <= 0':
                    - 'targeteffect.explode': '40'
                - 'if target_tagvalue_explosive > 0':
                    - 'message.target': "&e%{damage}"
                    - 'if damage == 2 and target.type.player':
                        - 'message.world': "&2Run for it! &7%{target_name}&2's gonna blow!"
                    - 'tag.target.explosive': '(target_tagvalue_explosive - 1)'
                    - 'delay.20': '_makeEmExplode'
Damage:
    - 'if attacker.type.player and projectile.type.arrow and attacker.haspermission.magicarrows':
        - 'message.attacker': "&6Plugged 'em with a bit o' magic. :3"
        - 'tag.target.explosive': '10' # Set the tag "explosive" on the enemy, with an associated value of 10. 
        - '_makeEmExplode'
        - '2' # Set the arrow damage to 2.

See also: Entity Type, Number Comparison

Clone this wiki locally