Elite Script Conditions
Conditions allow scripters to make scripts and / or actions not run based on specific conditions.
ConditionsAt script level the key is read case-sensitively. A lowercase conditions: there is ignored, so the script runs with no conditions at all and nothing is logged. Under an action the key is read in any case, but an action that contains both Conditions: and conditions: makes EliteMobs skip the whole script. Use a YAML mapping, not a list. The keys inside the block (isAlive, conditionType, Target, ...) are case-insensitive, but enum values such as BLOCKING and FILTERING must be uppercase.
Example
eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Conditions:
isAlive: true
conditionType: BLOCKING
Target:
targetType: SELF
Actions:
- action: PLACE_BLOCK
Target:
targetType: SELF
offset: 0,3,0
duration: 20
material: DIRT
Conditions:
locationIsAir: true
conditionType: FILTERING
Target:
targetType: ACTION_TARGET
Cooldowns:
local: 60
global: 20
Here Example requires a valid boss entity. The action checks the block 3 blocks above its location and places dirt there only if it is air, with a duration of 20 ticks. Each action can have its own conditions.
Target
Conditions use the Targets system. Their Target is separate from the action's Target and defaults to SELF when omitted. Use ACTION_TARGET with an action's FILTERING conditions to check its resolved targets individually.
Script conditions and BLOCKING action conditions resolve their own Target. Entity targets such as SELF or NEARBY_PLAYERS supply entities for every check. LOCATION and LOCATIONS supply no entities: only the location checks apply to their positions, and the target count is 0. ACTION_TARGET resolves nothing on this path, so only randomChance and the target counts apply. LANDING_LOCATION fails in script-level conditions because they run before a landing location exists.
Condition Type
| Key | Details | Values |
|---|---|---|
conditionType | Sets type of condition | BLOCKING / FILTERING |
BLOCKING rejects the entire script or the individual action where it is placed. Blocking one action does not block other actions in the script. FILTERING with ACTION_TARGET removes targets that fail the applicable checks.
Conditions outside of actions are always BLOCKING. Conditions inside of actions can be BLOCKING or FILTERING.
Note: if the target is SELF (the boss) and the condition check is isAlive, the check is always BLOCKING! This can be put inside of a FILTERING condition and will still make this specific part behave as BLOCKING.
Conditions inside of actions are set to FILTERING by default.
Use ACTION_TARGET with FILTERING to inspect each resolved action target. BLOCKING needs a concrete condition target such as SELF or NEARBY_PLAYERS; its current entity-count path does not resolve ACTION_TARGET.
randomChance, targetCountLowerThan, and targetCountGreaterThan are checked at script level or in BLOCKING action conditions. They are not evaluated by the per-target FILTERING path. Use a blocking condition when these checks must control an action.
Applicable checks are combined with AND. A blocking check requires every selected entity and location to pass. An empty selection does not itself fail these checks; use targetCountGreaterThan: 0 when at least one entity must be present. With a concrete condition target instead of ACTION_TARGET, filtering checks that separate selection and keeps all original action targets or removes all of them.
Filtering follows what the action requests: entity actions check entity validity, tags and the entity's unshifted feet location; location actions check only location conditions. Tags and isAlive cannot filter a location collection, apart from the special blocking SELF validity check above.
Script conditions run before actions are dispatched. Action blocking conditions run after wait and on each repeat; a failed blocking check cancels the remaining repeats of that action. Filtering out every target does not itself cancel future repeats. A failed script condition prevents its cooldown from starting; a failed action condition does not undo the script's cooldown.
Condition Block Placement
You can place or nest condition blocks in two ways:
-
Under individual actions – The condition will apply only to a specific action. If the condition is met, the action executes; otherwise, it does not.
-
Under the entire script – The condition applies to all actions within the script. If the condition is not met, none of the actions will execute.
Below are examples demonstrating how to nest condition blocks for both individual actions and the entire script.
Under individual actions:
Example
eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Actions:
- action: MESSAGE
Target:
targetType: NEARBY_PLAYERS
range: 10
sValue: "&2Hello World!"
- action: SET_WEATHER
Target:
targetType: SELF
weather: THUNDER
duration: 120
Conditions:
conditionType: BLOCKING
locationIsAir: true
Target:
targetType: SELF
offset: "0,3,0"
Both the block at the boss's feet and the block 3 blocks above must be air for SET_WEATHER to run. Blocking conditions check entity locations before checking offset locations. MESSAGE still runs because it has no condition.
Under the entire script:
Example
eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Actions:
- action: MESSAGE
Target:
targetType: NEARBY_PLAYERS
range: 10
sValue: "&2Hello World!"
- action: SET_WEATHER
Target:
targetType: SELF
weather: THUNDER
duration: 120
Conditions:
conditionType: BLOCKING
locationIsAir: true
Target:
targetType: SELF
offset: "0,3,0"
Both the block at the boss's feet and the block 3 blocks above must be air to allow both actions when the mob is hit. Otherwise the script is blocked, including SET_WEATHER and MESSAGE.
Reversing a condition with runIf...Is
Every condition has a companion runIf...Is key that flips it. All of them are booleans and all default to true (meaning "run when the condition is true"). Setting one to false inverts that condition.
There is no generic runIfConditionIs key -- each condition has its own exact name, and three of them do not follow the obvious pattern. An unrecognised key is not silently ignored; it logs Failed to read key ... for script ... on startup.
| Condition | Companion key | Notes |
|---|---|---|
isAlive | runIfAliveIs | ⚠️ Not runIfIsAliveIs |
hasTags | runIfHasTagIs | ⚠️ Singular Tag |
doesNotHaveTags | runIfDoesNotHaveTagIs | ⚠️ Singular Tag |
locationIsAir | runIfLocationIsAirIs | |
isOnFloor | runIfIsOnFloorIs | |
isStandingOnMaterial | runIfIsStandingOnMaterialIs | |
randomChance | runIfRandomChanceIs | |
targetCountLowerThan | runIfTargetCountLowerThanIs | |
targetCountGreaterThan | runIfTargetCountGreaterThanIs |
Condition key names are case-insensitive, so runifaliveis works too.
runIfConditionTypeIs does nothingrunIfConditionTypeIs is accepted by the parser without a warning, but nothing reads it. Use conditionType to choose BLOCKING or FILTERING; there is no way to invert it.
For example, locationIsAir: true normally requires air. Adding runIfLocationIsAirIs: false reverses that comparison and requires a non-air block. Reversal applies to the configured comparison, so combining a boolean condition set to false with its companion set to false reverses it again.
Example:
eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Actions:
- action: SET_WEATHER
Target:
targetType: SELF
weather: THUNDER
duration: 120
Conditions:
conditionType: BLOCKING
locationIsAir: true
runIfLocationIsAirIs: false
Target:
targetType: SELF
This action sets the weather to thunder only when the block at the boss's feet is not air, for example when the boss is in water. Reversing isAlive tests Bukkit validity; it does not create a death trigger, and a missing entity still fails even with inversion.
Location-based conditions
locationIsAir
Checks whether the target block is air, including cave air and void air. Set false to require a non-air block.
| Key | Details | Values |
|---|---|---|
locationIsAir | Sets to check if the location is an air block (or the opposite). | Boolean |
Example
eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Actions:
- action: SET_WEATHER
Target:
targetType: SELF
weather: THUNDER
duration: 120
Conditions:
conditionType: BLOCKING
locationIsAir: true
Target:
targetType: SELF
offset: "0,3,0"
The weather action requires air both at the boss's feet and 3 blocks above. For a location action that should check only its actual destination, use FILTERING with ACTION_TARGET, as in the first example.
isOnFloor
Checks that the block at the location is not solid and the block one unit below is solid. This is a material check, not an entity's physical on-ground state or a collision-shape test.
| Key | Details | Values |
|---|---|---|
isOnFloor | Sets to check if the location is a floor location (or the opposite). | Boolean |
Example
eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Actions:
- action: SET_WEATHER
Target:
targetType: SELF
weather: THUNDER
duration: 120
Conditions:
conditionType: BLOCKING
isOnFloor: true
Target:
targetType: SELF
The weather action runs only if the block at the boss's feet is non-solid and the block one unit below is solid. Failure blocks this action.
isStandingOnMaterial
Checks the exact material of the block one unit below the target location.
| Key | Details | Values |
|---|---|---|
isStandingOnMaterial | Sets which material type should be checked for. | Material |
Example
eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Actions:
- action: SET_WEATHER
Target:
targetType: SELF
weather: THUNDER
duration: 120
Conditions:
conditionType: BLOCKING
isStandingOnMaterial: BIRCH_WOOD
Target:
targetType: SELF
The weather action requires BIRCH_WOOD one unit below the boss's feet. BIRCH_LOG and BIRCH_PLANKS do not match. Failure blocks this action.
Entity-based conditions
isAlive
Checks the condition target's Bukkit isValid() state. This is a validity check, not a direct health comparison; a missing entity fails the check.
| Key | Details | Values |
|---|---|---|
isAlive | Expected Bukkit entity validity. | Boolean |
Example
eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Actions:
- action: SET_WEATHER
Target:
targetType: SELF
weather: THUNDER
duration: 120
Conditions:
conditionType: BLOCKING
isAlive: true
Target:
targetType: SELF
The weather action runs only while the boss's Bukkit entity is valid. Failure blocks this action.
hasTags
Requires all listed tags in EliteMobs' tag storage for a tracked elite or player. Tags are case-sensitive strings set through actions such as TAG and UNTAG. Vanilla scoreboard tags are not read, and ordinary mobs have no EliteMobs tag storage. Without that storage, hasTags fails and doesNotHaveTags passes before inversion.
| Key | Details | Values |
|---|---|---|
hasTags | Sets to check if the entity has a list of tags. | String List |
Example
eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Actions:
- action: SET_WEATHER
Target:
targetType: SELF
weather: THUNDER
duration: 120
Conditions:
conditionType: BLOCKING
hasTags:
- isCool
- hasANiceBeard
Target:
targetType: SELF
The weather action requires both isCool and hasANiceBeard on the boss. Failure blocks this action.
doesNotHaveTags
Passes when the target does not have all the listed tags. Missing at least one tag is enough. It does not require every listed tag to be absent.
| Key | Details | Values |
|---|---|---|
doesNotHaveTags | Sets to check if the entity does not have a list of tags. | String List |
Example
eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Actions:
- action: SET_WEATHER
Target:
targetType: SELF
weather: THUNDER
duration: 120
Conditions:
conditionType: BLOCKING
doesNotHaveTags:
- isStinky
- isSus
Target:
targetType: SELF
Runs unless the boss has both isStinky and isSus. A boss with only one of those tags still passes.
Other conditions
randomChance
Rolls a fresh random number each time the blocking checks reach this condition. Use a plain number from 0.0 (never) to 1.0 (always), not a ~ range. runIfRandomChanceIs: false reverses the result. On a repeated action, a failed roll cancels its remaining repeats.
| Key | Details | Values |
|---|---|---|
randomChance | Chance that the condition will be valid. | Number between 0.0 and 1.0 |
Example
eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Actions:
- action: SET_WEATHER
Target:
targetType: SELF
weather: THUNDER
duration: 120
Conditions:
conditionType: BLOCKING
randomChance: 0.1
Target: # Not required
targetType: SELF # Not required
This gives the weather action a 10% chance of running on each check. Failure blocks this action.
The explicit condition Target is optional because it defaults to SELF; omitting it does not disable other conditions in the same block.
Filter NEARBY with tags
To filter NEARBY_MOBS or NEARBY_PLAYERS based on specific tags, use ACTION_TARGET as the condition's target (If the condition is applied to an action and not the script itself). This ensures that the script accurately filters only the mobs/players with the specified tags.
Example
eliteScript:
Example:
Actions:
- action: SET_MOB_AI
Target:
targetType: NEARBY_MOBS
range: 40
bValue: false
Conditions:
conditionType: FILTERING
hasTags:
- TurnOff
Target:
targetType: ACTION_TARGET
This disables AI on tracked elites with the tag TurnOff in the search box extending 40 blocks along each axis, excluding the boss. Ordinary mobs do not have this tag storage. The example has no Events; call it from another script or add an event to trigger it.
targetCountLowerThan and targetCountGreaterThan
Compares the condition target's entity count before tag or other per-entity checks. It does not count the action's filtered targets. Comparisons are strict: equality does not pass.
| Key | Details | Values |
|---|---|---|
targetCountLowerThan | Only run if the condition's entity target count is strictly lower than the threshold. | Integer |
| Key | Details | Values |
|---|---|---|
targetCountGreaterThan | Only run if the condition's entity target count is strictly greater than the threshold. | Integer |
Example
eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Actions:
- action: SET_WEATHER
Target:
targetType: SELF
weather: THUNDER
duration: 120
Conditions:
conditionType: BLOCKING
targetCountGreaterThan: 2
Target:
targetType: NEARBY_MOBS
range: 15
The weather action runs only if more than 2 non-player living entities, excluding the boss, are in the search box extending 15 blocks along each axis.
Set the condition Target explicitly to count the intended population. Omitting it counts the default SELF selection instead. Use targetCountGreaterThan: 0 to require a nonempty selection.