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:
- A comparison operator
- 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:
- The attribute name
- A comparison operator
- 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:
- 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:
- The cause
Take a look at the available causes:
blockexplosion
,blockexplode
,blockexploded
- damage was caused by a block explosioncontact
,contacted
,contacting
,hazard
- damage was caused by a Cactus, Dripstone, Berry Bush, etccramming
,crammed
,cram
- damage was caused by entity crammingcustom
,customsource
- custom damagedragonbreath
,dragonbreathed
- damage was caused by a dragon breathingdrowning
,drowned
,drown
- damage was caused by running out of air while in waterentityattack
,entityattacked
- damage was caused by another entity directly attackingentityexplosion
,entityexplode
,entityexploded
- damage was caused by an entity exploding, such as a Creeperentityswipe
,entityswiped
,entitysweep
- damage was caused by a sweeping attack from another entityfall
,fell
,falling
- damage was caused by fallingfallingblock
,fallingblocks
- damage was caused by a falling block that deals damagedirectfire
,directfireexposure
,fireexposure
- damage caused by direct exposure to fireburn
,burned
,burning
,firetick
- damage caused by burns caused by fireflyintowall
,flyinwall
- damage caused by running/flying into a wallfreezing
,froze
,frozen
,freeze
- damage caused by freezinghotfloor
,magma
- damage caused by stepping on a magma blocklava
,lavaflow
,lavaflowed
,lavaflowing
- damage caused by direct exposure to lavalightning
,lightningstrike
,lightningstruck
- damage caused by being struck by lightningmagic
,magical
,magically
- damage caused by a damage potion or spellpoison
,poisoned
,poisoning
- damage caused by an ongoing Poison effectprojectile
,projectileattack
,projectileattacked
- damage caused by a projectilestarvation
,starved
,starving
,famine
- damage caused by starving due to having an empty hunger barsuffocation
,suffocated
- damage caused by being put in a blockplugin
,pluginenforcement
- damage caused by a pluginthorns
,thorn
,counter
,counterattack
- damage caused in retaliation to another attack by the Thorns enchantmentvoid
- damage caused by falling into the voidwither
,withering
,withered
- damage caused by an ongoing Wither effectworldborder
,border
- damage caused by the world borderkillcommand
,kill
- damage caused by being inflicted a/kill
commandmelting
,melt
- damage caused to a snowman by meltingdryout
,dry
- damage caused to squids, dolphins, etc. when they are exposed to the air with no watersonicboom
,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):
-
Comparing the damage value directly
- A comparison operator
- The value to compare to
-
Checking the damage lethality
- The word
lethal
to indicate lethal damage
- The word
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:
- The armor type, or start with a pound sign (
#
) andh
for helmet,c
for chestplate,l
for leggings andb
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:
- The direction type (either
h
for horizontal orv
for vertical) - 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 ande
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:
- A comparison operator
- 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:
- A comparison operator
- 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:
- 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:
- The hand to verify (start with
h
,m
orr
for main hand;o
orl
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:
- A comparison operator
- 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:
- 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:
- The item type, or start with the pound sign (
#
) andv
for vegetarian foods, orp
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:
- A comparison operator
- 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:
- A comparison operator
- 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:
- The statistic name
- A comparison operator
- 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:
- 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:
- The armor type, or start with a pound sign (
#
) andh
for helmet,c
for chestplate,l
for leggings andb
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:
- A comparison operator
- The value to compare to
Examples:
xp > 3000
This condition is marked as stable as of 2.2.