Introduction
Legacy Conditions (2.5.11 and below) can be found here.
Conditions are used to determine whether or not an action may execute. These conditions are placed under the Condition section in the configuration as shown below (bottom of page).
Conditions can be used on [1]:
- Skill Mechanics
- Drop Tables
- Spawners (deprecated condition system)
- Random Spawners
When applying multiple conditions, all of them must be met in order for the action to be executed. Some conditions allow arrays that can be split by commas. These conditions only require one of the strings in the arrays to match.
Usage
Types
Conditions can be broken into two types-
- General conditions: Those that can be used on entities and locations
or on entities only.
- Compare conditions: Those that need two entities or two locations. This conditions only make sense if used in TargetConditions section in the skill yamls. See CompareConditions!
Conditions that are used in the Conditions node of the skill:
- Every condition can be used.
- The caster is ALWAYS the entity that will be checked. All conditions can be used but conditions that compare 2 entities do not make sense here.
Conditions that are used in the TargetConditions node of the skill:
- Every condition can be used.
- TargetConditions node can only be used in skills.
- The compare entity depends on the targeter of the skill. If the skill use @self the compare entity is the caster if the skill use any other targeter the compare entity/location is the entity given in the targeter.
Examples
Conditions:
- globalscore{objective=Test;v=>10}
This condition is used under Conditions node and will always use the caster as compare entity. No matter what the targeter of the skill is.
TargetConditions:
- globalscore{objective=Test;v=>10}
This (the same) condition is used under TargetConditions node and will check the entity that is given by the targeter.
NOTE: CompareConditions only make sense in the TargetConditions node because they compare 2 entities where 1 of them is always the caster and the other one is the entitiy of the targeter. If they are used in the Conditions node the caster and the target are always the same.
Format:
Since 4.0.0, all conditions now have a new format.
Conditions:
- condition [variable]
- condition [variable] [action]
- condition [variable] [action] [action_variable]
- condition{variable1=value;variable2=value} [action] [action_variable]
These new "actions" control how the skill acts when a condition is met or not met. Here are some examples:
Conditions:
- day required
- stance defensive power 0.5
- stance{stance=defensive} power 0.5
- score{objective=test;value=>20} cancel
- haspotioneffect{type=POISON;level=>0;duration=0to100} true
Ranged Values:
Ranged values use either the format #to# or #-#. You must
use "to" instead of "-" if you want to use negative numbers in the
range. Here for example the distance condition:
TargetConditions:
- distance{d=1to10} true
TriggerConditions:
- distance{d=1to10} true
Conditions:
- altitude{a=1-5}
Condition Actions
Condition Actions allow you to do additional things based off of conditions. The default condition action is true
Action | Description |
---|---|
required (or true) | The condition is required for the skill to run. |
cancel (or false) | The skill will not run if this condition is met. |
power [multiplier] | Modifies the skill's power (e.i. power 2.0 would double the skill's power) |
cast [skill] | Casts an additional skill if the condition is met. |
castinstead [skill] | Casts a different skill instead if the condition is met. |
Conditions
Condition | Type | Description |
---|---|---|
Altitude | Entity | Tests how far above the ground the target entity is |
Biome | Location | Tests if the target is within the given list of biomes |
BlockType | Location | Tests the material type present at the target location |
Blocking | Entity | Tests if the target entity is blocking with a shield |
Children | Entity | Tests how many children the caster has |
Crouching | Entity | Whether or not the target entity is crouching |
Cuboid | Compare | Whether the target is within the given cuboid between location1 x location2 |
DamageAmount | Entity | Checks for a range of damage taken |
DamageCause | Entity | Checks the type of the damage cause |
Dawn | Location | If the time is dawn, from 22000 to 2000 in-game time |
Day | Location | If the time is day, from 2000 to 10000 in-game time |
Distance | Compare | Whether the distance between the caster and target is within the given range |
DistanceFromSpawn | Location | Whether the distance from the world's spawn point to the target is within the given range |
Dusk | Location | If the time is dusk, from 14000 to 18000 in-game time. |
EntityType | Entity | Tests the entity type of the target |
Faction | Entity | Tests for the targets faction |
FallSpeed | Entity | If the fall speed of the target is within the given range |
FieldOfView | Compare | Tests if the target is within the given angle from where the caster is looking |
Gliding | Entity | If the target is gliding |
Globalscore | Entity | Checks a global scoreboard value |
HasAura | Entity | Checks if the target entity has the given aura |
HasAuraStacks | Entity | Tests if the target has the given range of stacks from an aura |
HasCurrency | Entity | If the target has the given amount of vault currency |
HasInventorySpace | Entity | If the target has the given amount of empty inventory space |
HasOwner | Entity | Tests if the target mob has an owner |
HasParent | Entity | Tests if the target mob has a parent |
HasGravity | Entity | Tests if the target mob has gravity |
HasPotionEffect | Entity | Tests if the target entity has a potion effect |
HasTag | Entity | Tests if the target has a scoreboard tag |
Haspermission | Entity | Tests if the target player has a permission |
Health | Entity | Matches the target's health |
Height | Location | Checks if the target's Y location is within a range |
HeightAbove | Location | Checks if the target's Y location is above a value |
HeightBelow | Location | Checks if the target's Y location is below a given value |
Holding | Entity | Checks if the target is holding a given material |
Inblock | Location | Checks the material at the target location |
Incombat | Entity | If the target mob is considered in combat |
Inside | Location | Checks if the target has a block over their head |
ItemRecharging | Entity | Checks if the target's weapon is recharging |
LastDamageCause | Entity | Checks the target's last damage cause |
LastSignal | Entity | Matches the last signal received by the target mob |
Level | Entity | Checks the target MythicMob's level |
LightLevel | Location | Tests the light level at the target location |
LineOfSight | Compare | Tests if the target is within line of sight of the caster |
LunarPhase | Location | Checks the target world's lunar phase |
Mobsinradius | Location | Checks how many mobs are in a given radius |
Mobsinchunk | Location | Matches a range to how many mobs are in the target location's chunk |
Mobsinworld | Location | Matches a range to how many mobs are in the target world |
Mounted | Entity | If the target entity is riding a mount/vehicle |
Moving | Entity | If the target has a velocity greater than zero |
MythicMobType | Entity | Checks the MythicMob type of the target mob |
Night | Location | If the time is night, from 14000 to 22000 in-game time |
NotInRegion | Location | If the target location is not within the given WorldGuard region |
OffGCD | Entity | Checks if the target mob has an active Global Cooldown |
OnBlock | Location | Matches the block the target entity is standing on |
OnGround | Entity | If the target entity is standing on solid ground |
Outside | Location | If the target has open sky above them |
Owner | Compare | Checks if the target entity is the owner of the caster |
OwnerIsOnline | Entity | Checks if the owner of the target mob is online, if the owner is a player |
Pitch | Entity | Checks if the pitch of the target entity is within a range |
PlayerKills | Entity | Matches how many players the target mob has killed |
PlayerNotWithin | Location | Checks if any players are within a radius of the target |
PlayerWithin | Location | Checks if any players are within a radius of the target |
Raining | Location | If it's raining in the target world |
Region | Location | If the target is within the given WorldGuard region |
SameFaction | Entity | Tests if the caster and target are in the same faction |
Score | Entity | Checks a scoreboard value of the target entity |
Stance | Entity | Checks the stance of the target mob |
StringEquals | Meta | Checks if value1 equals value2. Both values can use variables and placeholders. |
Sunny | Location | If the weather is sunny in the target world. |
TargetInLineOfSight | Entity | Tests if the target has line of sight to their target |
TargetNotInLineOfSight | Entity | Tests if the target doesn't have line of sight to their target |
TargetWithin | Entity | Tests if the target's target is within a certain distance |
Targetnotwithin | Entity | Tests if the target's target is not within a certain distance |
Targets | Meta | Tests if the number of inherited targets from the parent skilltree matches the given range. |
Thundering | Location | If it's thundering in the target world |
VariableInRange | Meta | Checks if the given numeric variable is within a certain range. |
VariableIsSet | Meta | Checks if the given variable is set. |
Variableequals | Meta | Checks if the given variable has a particular value. |
Wearing | Entity | Tests what the target entity has equipped. |
World | Location | Checks the name of the target world. |
Worldtime | Location | Matches a range against the target location's world's time. |
Yaw | Entity | Checks the yaw of the target entity against a range. |
yDiff | Entity | Checks the difference in Y between the targeted entity and the caster. |
More Examples
FlameShock:
Cooldown: 1
Conditions:
- targetwithin 15
- targetinlineofsight true
- incombat
- stance aggressive
- onblock GRASS
- offgcd
Skills:
- gcd{t=60}
- message{m="<mob.name> begins casting a spell"}
- potion{t=SLOW;d=60;l=7}
- delay 60
- message{m="<target.name> &ecombusts"}
- effect:particles{p=flame;a=20;hS=3;vS=1;s=0;y=2}
- potion{t=HARM;d=1;l=1}
[1] Not all conditions may be applicable everywhere.