... | @@ -2,23 +2,14 @@ Introduction |
... | @@ -2,23 +2,14 @@ Introduction |
|
------------
|
|
------------
|
|
|
|
|
|
Conditions are used to determine whether or not an action may execute.
|
|
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).
|
|
|
|
|
|
|
|
Couldn't use [Variables](/skills/variables) in Condition's option
|
|
|
|
|
|
|
|
Conditions can be used in [1]:
|
|
Conditions can be used in [1]:
|
|
|
|
|
|
- [Skill Mechanics](/skills/mechanics/skill)
|
|
- [Skill Mechanics](/skills/mechanics/skill)
|
|
- [Drop Tables](/Items/Drops#drop-tables)
|
|
- [Drop Tables](/Items/Drops#drop-tables)
|
|
- [Spawners](/Spawners) (deprecated condition
|
|
- [Spawners](/Spawners)
|
|
system)
|
|
|
|
- [Random Spawners](/Random%20Spawns)
|
|
- [Random Spawners](/Random%20Spawns)
|
|
|
|
|
|
When applying multiple conditions, all of them must be met in order for
|
|
When applying multiple conditions, all of them must be met in order for the skill to be executed. Some conditions allow arrays that can be split by commas. Such conditions only require one of the strings in the array to match.
|
|
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.
|
|
|
|
|
|
|
|
To see how to use the premium only in-line target conditions, [click here!](/skills/conditions/in-linetargetconditions)
|
|
To see how to use the premium only in-line target conditions, [click here!](/skills/conditions/in-linetargetconditions)
|
|
|
|
|
... | @@ -28,87 +19,70 @@ Usage |
... | @@ -28,87 +19,70 @@ Usage |
|
### Types
|
|
### Types
|
|
|
|
|
|
|
|
|
|
Conditions can be broken into two types-
|
|
Conditions can be broken into three types:
|
|
|
|
|
|
1. 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:
|
|
1. Entity Conditions: These check the conditions of an entity.
|
|
|
|
2. Location Conditions: These check the conditions at a location. If a location condition is used while an entity is targeted, it will check the conditions at the entity's location.
|
|
|
|
3. Compare conditions: These check for certain conditions between two different "things". For example, "Cuboid" will return true if a target is within a cube where the corners are two coordinates, while "StringEquals" will return true or false depending on whether two strings match.
|
|
|
|
|
|
- Every condition can be used.
|
|
Conditions can also be used in three different places within a meta skill:
|
|
- 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:
|
|
1. Conditions: Conditions in this section check the conditions of the caster or the caster's location.
|
|
|
|
2. TargetConditions: Conditions in this section check the conditions of the target or target location inherited from the skill's targeter.
|
|
- Every condition can be used.
|
|
3. TriggerConditions: Conditions in this section check the conditions of the entity that triggered the skill.
|
|
- 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
|
|
### Examples
|
|
|
|
```
|
|
Conditions:
|
|
Conditions:
|
|
- globalscore{objective=Test;v=>10}
|
|
- globalscore{objective=Test;v=>10}
|
|
|
|
```
|
|
This condition is used under Conditions node and will always use the
|
|
In the example above, the globalscore condition will check the caster's global score.
|
|
caster as compare entity. No matter what the targeter of the skill is.
|
|
```
|
|
|
|
TargetConditions:
|
|
TargetConditions:
|
|
- globalscore{objective=Test;v=>10}
|
|
- globalscore{objective=Test;v=>10}
|
|
```
|
|
|
|
The example above uses the exact same condition, but here the globalscore condition will check the inherited target's global score. Since globalscore is an entity condition, it will only work if an entity is targeted.
|
|
This (the same) condition is used under TargetConditions node and will
|
|
|
|
check the entity that is given by the targeter.
|
|
**Format**:
|
|
|
|
```
|
|
NOTE: CompareConditions only make sense in the TargetConditions node
|
|
SkillName:
|
|
because they compare 2 entities where 1 of them is always the caster and
|
|
Conditions:
|
|
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]
|
|
|
|
TargetConditions:
|
|
- condition [variable] [action]
|
|
- condition [variable] [action]
|
|
|
|
TriggerConditions:
|
|
- condition [variable] [action] [action_variable]
|
|
- condition [variable] [action] [action_variable]
|
|
- condition{variable1=value;variable2=value} [action] [action_variable]
|
|
- condition{variable1=value;variable2=value} [action] [action_variable]
|
|
|
|
```
|
|
|
|
|
|
These new "actions" control how the skill acts when a condition is met
|
|
These new "actions" control how the skill acts when a condition is met
|
|
or not met. Here are some examples:
|
|
or not met. Here are some examples:
|
|
|
|
```
|
|
Conditions:
|
|
YourAwesomeSkill:
|
|
|
|
Conditions:
|
|
- day required
|
|
- day required
|
|
|
|
TargetConditions:
|
|
- stance defensive power 0.5
|
|
- stance defensive power 0.5
|
|
|
|
TriggerConditions:
|
|
- stance{stance=defensive} power 0.5
|
|
- stance{stance=defensive} power 0.5
|
|
- score{objective=test;value=>20} cancel
|
|
- score{objective=test;value=>20} cancel
|
|
- haspotioneffect{type=POISON;level=>0;duration=0to100} true
|
|
- haspotioneffect{type=POISON;level=>0;duration=0to100} true
|
|
|
|
```
|
|
**Ranged Values:**
|
|
**Ranged Values:**
|
|
Ranged values use either the format **#to#** or **#-#**. You must
|
|
Ranged values use either the format **#to#** or **#-#**. You must use "to" instead of "-" if you want to use negative numbers in the range. For:
|
|
use "to" instead of "-" if you want to use negative numbers in the
|
|
```
|
|
range. Here for example the distance condition:
|
|
YourMagnificentSkill:
|
|
|
|
Conditions:
|
|
TargetConditions:
|
|
- altitude{a=1-5}
|
|
|
|
TargetConditions:
|
|
- distance{d=1to10} true
|
|
- distance{d=1to10} true
|
|
|
|
TriggerConditions:
|
|
TriggerConditions:
|
|
|
|
- distance{d=1to10} true
|
|
- distance{d=1to10} true
|
|
|
|
```
|
|
Conditions:
|
|
|
|
- altitude{a=1-5}
|
|
|
|
|
|
|
|
Condition Actions
|
|
Condition Actions
|
|
-----------------
|
|
-----------------
|
|
|
|
|
|
Condition Actions allow you to do additional things based off of
|
|
Condition Actions allow you to do additional things based off of conditions. The default condition action is **true**
|
|
conditions. The default condition action is **true**
|
|
|
|
|
|
|
|
| Action | Description |
|
|
| Action | Description |
|
|
|----------------------------|----------------------------------------------------------------------------|
|
|
|----------------------------|----------------------------------------------------------------------------|
|
... | | ... | |