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):

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-

  1. General conditions: Those that can be used on entities and locations or on entities only.
  2. 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=0 to 100} 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
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
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
Crouching Entity Whether or not the target entity is crouching
Cuboid Compare Whether the target is within the given cuboid between location1 x location2
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
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
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
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
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.
  • distancefromspawn{distance=[ranged_value]
    • Available for entity & location targeters.
    • Tests for the distance from the world spawn point.
    • Can be ranged values (10-300), single numbers or >10 <77 etc.
    • Use the ranged value format with “-” and not “to”!
    • distancefromspawn{distance⇒100} true
  • fallspeed{speed=[number/number range]}
    • Available for entity targeters.
    • Can be ranged values (10-405), single numbers or >10 <77 etc. Can be negative. (For jumping.)
    • Note that you always seem to be falling while standing, at a speed of about 0.785.
    • fallspeed{speed⇒0.7845} true
  • gliding
    • Available for entity targeters.
    • Detects if the mob/entity is gliding with elytra.
    • You can trigger gliding on mobs using the Set Gliding mechanic.
    • gliding true
  • hasbuff{buffname=[string]
    • Checks if the caster have at least one buff with name buffname running.
    • hasbuff{buff=whatever}
  • hascurrency
    • Available for player targeters.
    • Checks if the player has enough money.
    • Needs Vault enabled in config.yml and installed and a economy plugin installed
    • hascurrency{a=20} true
  • hasinventoryspace
    • Available for player targeters.
    • Checks if there is a free slot in targets inventory.
    • hasinventoryspace true
  • hasparent
    • Available for mythicmobs mobs.
    • Checks if the mythicmobs mob have a living parent entity.
    • hasparent true
  • haspermission
    • Available for player targeters.
    • Checks if the player has that permission.
    • haspermission{p=apermission} true
  • haspotioneffect{type=[potion type];level=[level];duration=[duration start] to [duration end]}
    • Available for entity targeters.
    • Detects if the mob/entity has a potion effect, what level that effect is, and how long it'll last.
    • For level, you can specify a level, or a comparable. (>1 for greater than level 1)
    • The below example only runs if the target has the poison effect, stronger than level 1, and between 0 and 100 ticks. (5 seconds)
    • haspotioneffect{type=POISON;level⇒1;duration=0to100} true
  • hastag{tag=[tag name]}
    • Available for entity targeters.
    • Detects if the mob/entity has a scoreboard tag.
    • You can add tags to an target using the Add Tag mechanic.
    • hastag{tag=test} true
  • height [number_range]
    • Available for entity and location targeters.
    • Execute the skill if the mob is within a particular height range
    • Can be a single number, a ranged value (20-40), or >10 <5, etc.
    • Pressing F3 will show you your height for reference.
    • height 0-20
  • heightabove / heightbelow [number]
    • Available for entity and location targeters.
    • Execute the skill if the mob is above or below a particular height.
    • Pressing F3 will show you your height for reference.
    • heightabove 0
  • holding [itemname] NOT IMPLEMENTED
    • Executes the skill if the casting mob is holding [itemname].
    • Must be a Bukkit material name. Can't be a mythic item.
    • Due to a mysterious bug this condition can't test for items with durability (as of 2.2.1 and before).
    • holding STICK
  • inblock [material_type]
    • Available for entity and location targeters.
    • Execute the skill if the mob is in a particular block material.
    • Useful generally to check if a mob is in water, air, lava, etc rather than a solid material.
    • Allows arrays/data splits
    • Note that for mobs inside water blocks, you want STATIONARY_WATER instead of just WATER.
    • inblock WATER
  • incombat
    • Available for entity targeters.
    • Execute the skill if the mob is currently in combat (mob has a target).
    • Only available for mobs with enabled threattable!
    • incombat true
  • itemrecharging
    • Available for players.
    • Execute the skill if the item in hand of player is reloading.
    • itemrecharging true/false
  • lastsignal{s=[signal]}
    • Available for entity targeters.
    • Execute the skill if the last signal received matches [signal] - see signal-skill
    • Unlike the stance condition, the lastsignal condition checks for perfectly matching data.
    • lastsignal{s=ping}
  • level [number_range]
    • Available for entity targeters.
    • Execute the skill if the mob is of a particular level range.
    • Can be a single number, a ranged value (20-40), or >10 <5, etc.
    • level >3
  • lightlevel{l=[ranged_value]}
    • Available for entity and location targeters.
    • Execute the skill if the mob in a light level within a certain range.
    • Must be a number between 0 and 15.
    • lightlevel{l=0to3}
  • lunarphase{p=[days]}
    • Available for entity and location targeters.
    • Execute the skill if it is a particular day.
    • Comma separated list of game days (0*7) representing the lunar phase.
    • lunarphase{p=4,5,6}
  • mobsinchunk{a=[ranged_value]}
    • Available for entity and location targeters.
    • Execute the skill if a certain amount of mobs are present in the chunk.
    • Can be a single number, a ranged value (20to40), or >10 <5, etc.
    • mobsinchunk{a=<5} true
  • mobsinworld [ranged_value]
    • Available for entity and location targeters.
    • Execute the skill if a certain amount of mobs are present in the world.
    • Can be a single number, a ranged value (20to40), or >10 <5, etc.
    • mobsinworld{a⇒100}
  • Mounted
    • Available for entity targeters.
    • Check if the entity has a vehicle.
    • mounted true
  • MythicMobType{t=mythicmobinternalnames}
    • Available for entity targeters.
    • Check if the entity is a mythicmobs mob of type.
    • Allows multiple types by “,”
    • mythicmobtype{types=TheSkeletonKing,Another7331Mob} true
  • Night
    • Available for entity and location targeters.
    • Time in world of location is >= 14000 and ⇐ 22000.
    • night true
  • NotInRegion{region=WORLDGUARD_REGION_NAME}
    • Available for entity and location targeters.
    • Check if the target is not in the region.
    • notinregion{r=spawn} true
  • offgcd
    • Available for entity targeters.
    • Executes the skill if the mobs global cooldown is 0.
    • The mobs global cooldown is a time period or delay during which the mob can not execute any skills (if defined as such using this condition)
    • Must use the GCD skill to set the global cooldown in a skill or the global cooldown will always be 0.
    • Frequently used for mobs that have more than one spell or skill to keep them from casting them simultaneously which generally is not preferred.
    • offgcd
  • onground
    • Available for entity targeters.
    • Execute the skill if the caster is on the ground.
    • onground true
  • outside/inside [true/false]
    • Available for entity and location targeters.
    • Execute the skill if location is either inside or outside.
    • Outside is defined by the location having a clear line of sight to the sky. Inside is the opposite.
    • outside true
  • ownerisonline
    • Available for mythicmobs mobs with a player as owner.
    • Checks if the mobs owner is online.
    • ownerisonline true
  • pitch
    • Checks the target entity's pitch.
    • pitch 20to40
    • pitch <100
  • PlayerKills{kills=[number]}
    • Available for entity targeters.
    • Execute the skill if the mob's playerkill-count matches.
    • Ranged values are allowed. > or < or = or (0to20).
    • playerkills{kills⇒2} true
  • playernotwithin/targetnotwithin{d=[distance]}
    • Available for entity targeters or player targets only if playerwithin is used.
    • Execute the skill if the player is not within a certain amount of blocks.
    • Accepts a single number. If you wish to use a range, use targetdistance condition instead.
    • playernotwithin{d=5}
    • targetnotwithin{d=2}
  • playerwithin/targetwithin{d=[distance]}
    • Available for entity targeters or player targets only if playerwithin is used.
    • Execute the skill if the player/entity is within a certain amount of blocks.
    • Accepts a single number. If you wish to use a range, use targetdistance condition instead.
    • Frequently used along with lineofsight condition to keep mobs from using skills on players that they can't see or are too far away.
    • playerwithin{d=15}
    • targetwithin{d=2}
  • raining
    • Available for entity and location targeters.
    • Executes the skill if it is raining or not.
    • raining false
  • Region{r=[region_name]}
    • Available for entity and location targeters.
    • Check if the location is in the worldguard region or not.
    • region{r=spawn} true
    • region{r=spawn} false
  • score{objective=[objective name];entry=[entry];value=[value]}
    • Available for entity targeters.
    • Tests the value of the entry in scoreboards objective objective.
    • If entry is not given, the player name (if the target is a player) or the uuid (if target is a entity) will be used as entry.
    • score{objective=test;v⇒20} true
    • This check if the value of entry [player_name/entity_uuid] in objective test is greater 20.
    • score{o=test;entry=counter;value=<20} true
    • This check if the value of the entry counter in objective test is smaller than 20.
  • scoreglobal{objective=[objective name];value=[value]}
    • Available for entity targeters.
    • Tests the value of the GLOBAL entry in scoreboards objective objective.
    • scoreglobal{objective=test;v⇒20} true
  • stance{s=[string]}
    • Available for entity targeters.
    • Executes the skill if the mob is in a particular stance.
    • Stance variable must be defined previously using the setstance skill and can be any string that makes sense to the player for the skill being designed.
    • The stance condition will check for the given string being contained in the current stance. This allows complex usage of the condition. For instance if your mob's stance is AGGRO and your stance condition only checks for GG the stance will match.
    • stance{s=defensive} true
  • sunny
    • Available for entity and location targeters.
    • Executes the skill if it is sunny or not.
    • sunny true
  • lineofsight
    • Check if the entity has its target in sight.
    • lineofsight true
  • targetwithin/targetnotwithin{d=[value]}
    • Executes the skill if the target falls within/not within the specified distance from the entity
    • Can be a single number, >10 <5 or = etc.
    • targetwithin{d=2}
  • tcbiome{biome=[string];strict=[boolean]
    • Available for entity and location targeters.
    • Executes the skill if the caster is in the TerrainControl biome
    • Can be matched strictly or loosely
    • tcbiome Forest (Matches any TerrainControl biome whose name contains FOREST)
    • tcbiome{biome=TropicalDesert;strict=true} Would match only TropicalDesert, not TropicalDesertBorder
  • thundering
    • Available for entity and location targeters.
    • Executes a skill if it is thundering or not.
    • thundering false
  • wearing
    • Condition to check the armor slots of living entities for normal or mythic items.
    • wearing{slot=helmet;material=DIAMOND_HELMET} true
    • wearing{slot=chestplate;mmitem=AnItem}
  • world [worldname]
    • Available for entity and location targeters.
    • Executes a skill if in a particular world.
    • Can be single world or a comma separated list.
    • Allows arrays/data splits
    • world snowyworld,lavaworld,islandworld
  • worldtime [number_range]
    • Available for entity and location targeters.
    • Executes a skill if during a particular time of day.
    • Valid values are between 0 and 24000. (/time will tell you the time of day in ticks)
    • 0-12000 is the minecraft day. 12001-13800 is dusk, 13801-22200 is night, 22201-24000 is dawn
    • worldtime 0-12000
  • yaw [number_range]
    • Checks the target entity's yaw.
    • yaw >50
    • yaw 50to100

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.

conditions/start.txt · Last modified: 2019/07/09 10:16 by wahrheit