Skip to content

Built-in conditions

This is an exhaustive list of all conditions provided by UnderscoreEnchants as of v2.2. You are expected to be familiar with the syntax of conditions and how to work with them, as outlined in the enchantments guide.

air

Info

Checks the amount of air that the entity has in ticks (1 tick = 0.05 seconds).

Aliases: breath, oxygen, airticks, oxygenticks, airleft, oxygenleft, airticksleft, oxygenticksleft, airremaining, oxygenremaining, airticksremaining, oxygenticksremaining, air-ticks,oxygen-ticks, air-left, oxygen-left, air-ticks-left, oxygen-ticks-left, air-remaining, oxygen-remaining, air-ticks-remaining, oxygen-ticks-remaining

Arguments:

  1. A comparison operator
  2. The value to compare to

Example:

  • air <= 100

This condition is marked as stable as of 2.2.

attr

Info

Checks the value of an attribute of an entity.

Aliases: attr, attribute, attribute-value, attr-value, attributevalue, attrvalue, attr-val, attribute-val, attributeval, attrval

Arguments:

  1. The attribute name
  2. A comparison operator
  3. The value to compare to

Example:

  • attribute GENERIC_MOVEMENT_SPEED < 3

This condition is marked as stable as of 2.2.

blocking

Info

Checks if the player is blocking their shield.

Aliases: isblocking, is-blocking

This condition is marked as stable as of 2.2.

block-is

Info

Checks the block type of the block affected in the event. If none is affected, silently fails.

Aliases: blockis

Arguments:

  1. The block type

Example:

  • block-is DIAMOND_BLOCK

This condition is marked as stable as of 2.2.

cause

Info

Checks the cause of the damage. If the event does not imply any damage to an entity, silently fails.

Aliases: causeis, damagecause, damagecauseis, cause-is, damage-cause, damage-cause-is

Arguments:

  1. The cause

Take a look at the available causes:

  • blockexplosion, blockexplode, blockexploded - damage was caused by a block explosion
  • contact, contacted, contacting, hazard - damage was caused by a Cactus, Dripstone, Berry Bush, etc
  • cramming, crammed, cram - damage was caused by entity cramming
  • custom, customsource - custom damage
  • dragonbreath, dragonbreathed - damage was caused by a dragon breathing
  • drowning, drowned, drown - damage was caused by running out of air while in water
  • entityattack, entityattacked - damage was caused by another entity directly attacking
  • entityexplosion, entityexplode, entityexploded - damage was caused by an entity exploding, such as a Creeper
  • entityswipe, entityswiped, entitysweep - damage was caused by a sweeping attack from another entity
  • fall, fell, falling - damage was caused by falling
  • fallingblock, fallingblocks - damage was caused by a falling block that deals damage
  • directfire, directfireexposure, fireexposure - damage caused by direct exposure to fire
  • burn, burned, burning, firetick - damage caused by burns caused by fire
  • flyintowall, flyinwall - damage caused by running/flying into a wall
  • freezing, froze, frozen, freeze - damage caused by freezing
  • hotfloor, magma - damage caused by stepping on a magma block
  • lava, lavaflow, lavaflowed, lavaflowing - damage caused by direct exposure to lava
  • lightning, lightningstrike, lightningstruck - damage caused by being struck by lightning
  • magic, magical, magically - damage caused by a damage potion or spell
  • poison, poisoned, poisoning - damage caused by an ongoing Poison effect
  • projectile, projectileattack, projectileattacked - damage caused by a projectile
  • starvation, starved, starving, famine - damage caused by starving due to having an empty hunger bar
  • suffocation, suffocated - damage caused by being put in a block
  • plugin, pluginenforcement - damage caused by a plugin
  • thorns, thorn, counter, counterattack - damage caused in retaliation to another attack by the Thorns enchantment
  • void - damage caused by falling into the void
  • wither, withering, withered - damage caused by an ongoing Wither effect
  • worldborder, border - damage caused by the world border
  • killcommand, kill - damage caused by being inflicted a /kill command
  • melting, melt - damage caused to a snowman by melting
  • dryout, dry - damage caused to squids, dolphins, etc. when they are exposed to the air with no water
  • sonicboom, sonic - damage caused by a Warden's Sonic Boom

Example:

  • cause magic

This condition is marked as stable as of 2.2.

damage

Info

Checks the dealt damage.

Aliases: dmg

Arguments (two variants):

  1. Comparing the damage value directly

    1. A comparison operator
    2. The value to compare to
  2. Checking the damage lethality

    1. The word lethal to indicate lethal damage

Example:

  • dmg <= 6

This condition is marked as stable as of 2.2.

day

Info

Checks whether it's daytime in the world of the entity.

Aliases: isday, daytime, isdaytime, is-day, is-daytime, is-day-time

This condition is marked as stable as of 2.2.

easy

Info

Checks whether the difficulty is easy in the world of the entity.

Aliases: easydifficulty, iseasydifficulty, easydiff, iseasydiff, easy-difficulty, is-easy-difficulty, easy-diff, is-easy-diff

This condition is marked as stable as of 2.2.

end

Info

Checks whether the entity is in The End.

Aliases: isend, inend, isinend, theend, istheend, intheend, isintheend, is-end, in-end, is-in-end, is-the-end, in-the-end, is-in-the-end

This condition is marked as stable as of 2.2.

equipped

Info

Checks what type of item the player has put on. This condition will fail if the trigger isn't the built-in ArmorEquip trigger.

Aliases: equip, puton, put-on

Arguments:

  1. The armor type, or start with a pound sign (#) and h for helmet, c for chestplate, l for leggings and b for boots

Examples:

  • equipped DIAMOND_BOOTS
  • equipped #helm

This condition is marked as stable as of 2.2.

facing

Info

Checks the direction that the player is facing.

Aliases: dir

Arguments:

  1. The direction type (either h for horizontal or v for vertical)
  2. The expected direction (if vertical, d for down, u for up, f for forward; if horizontal, s for south, w for west, n for north and e for east)

Examples:

  • facing horizontal south
  • facing v d

This condition is marked as stable as of 2.2.

food

Info

Checks the player's food level.

Aliases: hunger, foodlevel, hungerlevel, food-level, hunger-level

Arguments:

  1. A comparison operator
  2. The value to compare to

Example:

  • food > 18

This condition is marked as stable as of 2.2.

force

Info

Checks the force with which an arrow has been shot. This condition will fail if the trigger isn't the built-in PlayerShootBow trigger.

Arguments:

  1. A comparison operator
  2. The value to compare to

Example:

  • force > 0.3

This condition is marked as stable as of 2.2.

from-is

Info

Checks the block type of the block that the player moved from. This condition will fail if the trigger isn't the built-in PlayerMove trigger.

Aliases: fromis

Arguments:

  1. The block type

Example:

  • from-is DIAMOND_BLOCK

This condition is marked as stable as of 2.2.

hand-is

Info

Checks whether an interact event is main hand or off hand.

Aliases: hand, handis

Arguments:

  1. The hand to verify (start with h, m or r for main hand; o or l for off hand)

Example:

  • hand main

hardcore

Info

Checks whether the entity's world is hardcore.

Aliases: ishardcore, is-hardcore

This condition is marked as stable as of 2.2.

hard

Info

Checks whether the difficulty is hard in the world of the entity.

Aliases: harddifficulty, isharddifficulty, harddiff, isharddiff, hard-difficulty, is-hard-difficulty, hard-diff, is-hard-diff

This condition is marked as stable as of 2.2.

hp

Info

Checks the player's health.

Aliases: health, healthpoints, health-points, hitpoints, hit-points

Arguments:

  1. A comparison operator
  2. The value to compare to

Example:

  • hp > 18

This condition is marked as stable as of 2.2.

interact

Info

Checks the type of interaction.

Aliases: interact, interacted, interacting, interaction, world-interact, world-interacted, world-interacting, world-interaction

Arguments:

  1. The type of interaction to expect (lmbair/leftair for left-clicking air; rmbair/rightair for right-clicking air; lmbblock/leftblock for left-clicking a block; rmbblock/rightblock for right-clicking a block; phys/push/physical for a physical interaction, e.g. pressure plates)

Example:

  • interact lmbair (verifies that the interact type is left-clicking on air)

This condition is marked as stable as of 2.2.

in-water

Info

Checks whether an entity is in water.

Aliases: inwater, isinwater, is-in-water

This condition is marked as stable as of 2.2.

item-is

Info

Checks the type of an item involved in the event (don't forget to specify the target for such conditions).

Aliases: itemis

Arguments:

  1. The item type, or start with the pound sign (#) and v for vegetarian foods, or p for pescetarian foods

Examples:

  • item-is #p
  • item-is DIAMOND_PICKAXE

This condition is marked as stable as of 2.2.

level

Info

Checks the player's level.

Aliases: lvl, xplevel, xplvl, explevel, explvl, xp-level, exp-level, xp-lvl, exp-lvl

Arguments:

  1. A comparison operator
  2. The value to compare to

Example:

  • level > 18

This condition is marked as stable as of 2.2.

money

Info

Checks the player's balance, either using Treasury's or Vault's economy (whichever is present, with Treasury taking the priority if both are). If none of them are present, silently fails.

Aliases: balance, moneybalance, money-balance, bal

Arguments:

  1. A comparison operator
  2. The value to compare to

Example:

  • bal > 18000

This condition is marked as stable as of 2.2.

nether

Info

Checks if the entity is in the nether.

Aliases: isnether, innether, isinnether, is-nether, in-nether, is-in-nether

This condition is marked as stable as of 2.2.

normal

Info

Checks whether the difficulty is normal in the world of the entity.

Aliases: normaldifficulty, isnormaldifficulty, normaldiff, isnormaldiff, normal-difficulty, is-normal-difficulty, normal-diff, is-normal-diff

This condition is marked as stable as of 2.2.

on-fire

Info

Checks whether the entity is burning.

Aliases: onfire, isonfire, burning, isburning, burn, isburn, ablaze, isablaze, inflame, isinflame, inflames, isinflames, is-onfire, is-on-fire, is-burning, is-burn, is-ablaze, is-inflame

This condition is marked as stable as of 2.2.

on-top

Info

Checks whether the entity is standing at the highest point of its X and Z coordinates - in other words, if there are no blocks above the entity.

Aliases: ontop, isontop, highest, ishighest, highestblock, ishighestblock, onhighestblock, isonhighestblock, is-on-top, is-highest, is-highest-block, is-on-highest-block

This condition is marked as stable as of 2.2.

op

Info

Checks whether the player is an operator.

Aliases: isop, operator, isoperator, is-op, is-operator

This condition is marked as stable as of 2.2.

overworld

Info

Checks whether the player is in the overworld.

Aliases: isoverworld, inoverworld, isinoverworld, is-overworld, in-overworld, is-in-overworld

This condition is marked as stable as of 2.2.

peaceful

Info

Checks whether the difficulty is peaceful in the entity's world.

Aliases: peacedifficulty, ispeacedifficulty, peacediff, ispeacediff, peacefuldifficulty, ispeacefuldifficulty, peacefuldiff, ispeacefuldiff, peace-difficulty, is-peace-difficulty, peace-diff, is-peace-diff, peaceful-difficulty, is-peaceful-difficulty, peaceful-diff, is-peaceful-diff, peace

This condition is marked as stable as of 2.2.

rain

Info

Checks whether it's raining in the entity's world.

Aliases: israin, raining, israining, storm, isstorm, storming, isstorming, is-rain, is-raining, is-storm, is-storming

This condition is marked as stable as of 2.2.

sleeping

Info

Checks whether the entity is asleep.

Aliases: issleeping, is-sleeping, asleep, isasleep, is-asleep, sleep, issleep, is-sleep, inbed, isinbed, is-in-bed, in-bed, is-inbed

This condition is marked as stable as of 2.2.

sneaking

Info

Checks whether the player is sneaking.

Aliases: sneak, issneak, issneaking, shift, isshift, shifting, isshifting, is-sneak, is-sneaking, is-shift, is-shifting

This condition is marked as stable as of 2.2.

sprinting

Info

Checks whether the player is sprinting.

Aliases: sprint, issprint, issprinting, run, isrun, running, isrunning, is-sprint, is-sprinting, is-run, is-running

This condition is marked as stable as of 2.2.

stat

Info

Checks the value of an statistic of a player.

Aliases: statistic, statistic-value, stat-value, statisticvalue, statvalue, stat-val, statistic-val, statisticval, statval

Arguments:

  1. The statistic name
  2. A comparison operator
  3. The value to compare to

Example:

  • stat DAMAGE_DEALT > 10000

This condition is marked as stable as of 2.2.

swimming

Info

Checks whether an entity is swimming.

Aliases: swim, isswim, isswimming, is-swim, is-swimming

This condition is marked as stable as of 2.2.

thunder

Info

Checks whether it's thundering in the entity's world.

Aliases: isthunder, thundering, isthundering, lightning, islightning, is-lightning, is-thunder, is-thundering

This condition is marked as stable as of 2.2.

sneaked

Info

Checks whtether the player started sneaking. This condition will fail if the trigger is not the built-in PlayerToggleSneak trigger.

Aliases: shifted

This condition is marked as stable as of 2.2.

to-is

Info

Checks the block type of the block that the player moved to. This condition will fail if the trigger isn't the built-in PlayerMove trigger.

Aliases: tois

Arguments:

  1. The block type

Example:

  • to-is DIAMOND_BLOCK

This condition is marked as stable as of 2.2.

unequipped

Info

Checks what type of item the player has taken off. This condition will fail if the trigger isn't the built-in ArmorEquip trigger.

Aliases: unequip, tookoff, took-off

Arguments:

  1. The armor type, or start with a pound sign (#) and h for helmet, c for chestplate, l for leggings and b for boots

Examples:

  • unequipped DIAMOND_BOOTS
  • unequipped #helm

This condition is marked as stable as of 2.2.

xp

Info

Checks the total experience of the player.

Aliases: xp, experience, exp, experiencepoints, totalxp, totalexperience, totalexp, totalexperiencepoints, total-experience, total-experience-points, total-xp, total-experience, experience-points

Arguments:

  1. A comparison operator
  2. The value to compare to

Examples:

  • xp > 3000

This condition is marked as stable as of 2.2.