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

Conditional: Wearing

chrisman0091 edited this page Dec 30, 2012 · 3 revisions

Syntax: {entity}.wearing[only].{armorset}

Description: Is true if an inclusive comparison of the specified entity's armor set matches. If "wearingonly" is used, returns true if a comparison of the specified entity's armor set matches exactly.

Note: Make sure to test this conditional carefully, as it does not always work as expected.

Example:

Damage: #Any player wearing an iron helmet has reduced explosion damage.
    - 'if target.wearing.IRON_HELMET and attacker.type.explosion': '-2'
Damage: #Reduce PvP damage if and only if the target is wearing gold leggings.
    - 'if attacker.type.player and target.wearingonly.GOLD_LEGGINGS': '/2'

Multiple armor sets can be evaluated in the same line or in an alias if one likes:

Aliases:
    Armor:
        metalPants:
            - 'GOLD_LEGGINGS'
            - 'IRON_LEGGINGS'
        metalPantsAgain:
            - 'GOLD_LEGGINGS,IRON_LEGGINGS'
Damage: # These three lines should always output at the same time.
    - 'if target.wearing.GOLD_LEGGINGS,IRON_LEGGINGS': 'message.target': "HELLO"
    - 'if target.wearing._metalPants': 'message.target': "WORLD"
    - 'if target.wearing._metalPantsAgain': 'message.target': "!"

See also: EntityType, Value Change

Clone this wiki locally