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

Conditional: Entity Status

1cec0ld edited this page Dec 18, 2012 · 5 revisions

Syntax: {entity}.is{status}

Description: Evaluates whether a condition corresponding to a particular "status" is true or not. This particular Conditional is meant to approach a large number of common evaluations for entities that may or may not be possible to evaluate elsewhere.

The {status} in the syntax above may be replaced with any of the following:

  • Drowning

    Returns true if the entity's head is submerged and their air ticks are at 0.

    Damage: #People who can't breathe have a hard time fighting.
        - 'if attacker.isDrowning': '-5'
  • ExposedToSky

    Checks every block above the entity's head for blocks that are considered interference with sunlight. The whitelisted blocks that do not count against this can be found at the EntityStatus.java source in MD. Returns true if there are no obstructions.

    Damage: #Sets the damage for a Vampire to 0 unless they're hit by the right element of nature, a wood item, or exposed to the sky.
        - 'if target.group.Vampire':
            - 'if_not attacker.type._hurtsVampire or attacker.wielding._WoodItems or target.isExposedToSky': '0'
    
    Aliases:
        Item:
            WoodItems:
                - 'WOOD_SWORD'
                - 'WOOD_HOE'
                - 'WOOD_SPADE'
                - 'WOOD_PICKAXE'
                - 'WOOD_AXE'
        Element:
            hurtsVampire:
                - 'fire'
                - 'burning'
                - 'lava'
                - 'thunder'
                - 'drowning'
  • Falling

    Returns true if the entity has a negative Y velocity. This is effectively a check for MC-vanilla crits as well, since this is technically the criteria that's used.

    Damage: #Hits while falling are half damage.
        - 'if target.isFalling': 'div.2'
    Damage: # Attacking a slime while falling pushes the attacker back.
        - 'if target.type.slime and attacker.isFalling':
            - 'targeteffect.knockback': '1'

    Another good example of the use of the Falling condition is located at FAQ: How do I detect whether a player is critically hitting in vanilla MC?.

  • OnFire

    Returns true if the entity's fire ticks are greater than 0.

    Damage: #Make fire super-effective against the cold hearts of admins.
        - 'if target.group.Admins and target.isOnFire':
            - 'mult.2'
            - "message.attacker.It's super effective!"
  • Sleeping

    Returns true if the entity is a player and asleep.

    Damage: #Assassins instakill anything that sleeps.
        - 'if attacker.group.Assassin and target.isSleeping': 'set.200'
  • Sneaking

    Returns true if the entity is a player and sneaking.

    Damage: #Low blows deal more damage. XD
        - 'if attacker.isSneaking and target.type.human': '2'
  • Sprinting

    Returns true if the entity is a player and sprinting.

    Damage: # Even more imbalanced knockback for sprint-hits!
        - 'if attacker.isSprinting and attacker.haspermission.customperms.knockback': # Case doesn't matter as usual, but this is easier to read than all lowercase.
            - "message.attacker.&6BAM!"
            - 'targeteffect.knockback': '3' # Rather strong knockback.
  • Flying

    Returns true if a player has double jumped, and is in Flying mode, usually while in Creative Gamemode.

  • Underwater

    Returns true if the entity's Location and EyeLocation (see source linked above) are in Water blocks.

    Damage: #Make Squid-hunting harder - force them to attack from the surface!
        - 'if attacker.isUnderwater and target.type.squid': 'set.0'

See also: Entity Type, Group, Knockback, Message, Permission, Value Change, Wielding

Clone this wiki locally