Skip to content

Routine: Change Value

ricochet1k edited this page Mar 15, 2012 · 2 revisions

Adds or sets default integer. Note that not all properties, like server_playercount, are settable. See Integer Variable References for properties that can be set.

Syntax

- '(set|change).{integer_variable}': '{expression}'

or

- '(set|change).{integer_variable}':
    - '{expression or routines}'

Examples

Food: #Make food give you air.
    - '0' # remove healing effect
    - 'set.target_airticks': '+100' # add 100 to air ticks
Damage: #If a player is struck by a player wielding a fire block, give chance to set
      # to set them on fire.
    - 'if attacker.wielding.fire and chance.5':
        - 'set.target_fireticks': '+200' # 10 seconds of fire!
Damage: #Punish squid poachers.
    - 'if target.type.squid':
        - 'set.attacker_airticks': '0'
Damage: #Slime attacks douse the target.
    - 'if attacker.type.Slime':
        - 'set.target_fireticks': '0'
Damage: #Make a group heal others to full health.
    - 'if attacker.group.Healers and target.type.player':
        - 'set.target_health': '20'
Damage: #It's gonna take something incredible to kill Slimes now.
    - 'if damage < 14':
        - 'set.target_size': '8' # Note that setting size resets the mob health, since Bukkit replaces the entity.
Spawn: #Every time a Dark God is born, the sun goes out temporarily. :P
    - 'if target.group.DarkGod':
        - 'set.world_time': '18000'
        - 'message.server._message1'
Aliases:
    Message:
        message1:
            - '&4Oh crap.'
            - '&4RUN FOR YOUR &3LIVES'

See also: Set, Chance, Group Evaluation, Type Evaluation, Message

Clone this wiki locally