Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
MythicMobs MythicMobs
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 136
    • Issues 136
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • MythicCraft
  • MythicMobsMythicMobs
  • Wiki
    • Skills
  • Inline Conditions

Inline Conditions · Changes

Page history
renamed inline conditions wiki page authored Sep 02, 2024 by Lxlp's avatar Lxlp
Hide whitespace changes
Inline Side-by-side
Showing with 0 additions and 0 deletions
+0 -0
  • Skills/Inline-Conditions.md Skills/Inline-Conditions.md +0 -0
  • No files found.
Skills/Inline-Conditions.md 0 → 100644
View page @ 12fdec2e
In-Line conditions can be used on individual mechanics and targeters to save you from having to create an entire metaskill for more basic things and to give you more flexibility inside existing metaskills. You can use standard Conditions to check against the caster, TriggerCondtions to check against the trigger, and TargetConditions to check against the target.
In-Line conditions can be used in mob files, skills files and if you have Crucible, they can be used in item files too.
[[_TOC_]]
# Conditions
These conditions will check against the caster itself, they go at the end of a mechanic line and begin with `?`. In the below example the message will only be sent if it is currently raining.
```yaml
SkeletalKnight:
Type: WITHER_SKELETON
Skills:
- messaage{m="You hit me in the rain?"} @trigger ~onDamaged ?raining
```
For the condition to be true, you can use `?` and for the condition to be false you use `?!`
- `?raining` - True, if it *is* raining
- `?!raining` - False, if it is *not* raining
# TriggerConditions
You can also check against the trigger of the mechanic. It is the same process as above but you use a `~` after the ?. The below example will only send a message to the player who hit the mob, if that player is holding a wooden sword.
```yaml
SkeletalKnight:
Type: WITHER_SKELETON
Skills:
- message{m="You hit me with a wooden sword?"} @trigger ~onDamaged ?~holding{m=WOODEN_SWORD}
```
Just like the standard conditions, for true you can use `?~` and for the condition to be false you use `?~!`
- `?~holding{m=WOODEN_SWORD}` - True, if the player *is* holding a wooden sword
- `?~!holding{m=WOODEN_SWORD}` - False, if the player is *not* holding a wooden sword
### Multiple Conditions
You are able to use as many In-line Conditions and TriggerConditions as you need in your mechanics. Just remember that *all* conditions have to be met for the mechanic to run, in this below example the message will only be sent if it is raining, *and* night, *and* the player who attacked the mob is holding a wooden sword.
```yaml
SkeletalKnight:
Type: WITHER_SKELETON
Skills:
- message{m="You hit me with a wooden sword? in the rain?? at night???"} @trigger ~onDamaged ?raining ?night ?~holding{m=WOODEN_SWORD}
```
# TargetConditions
**In-Line TargetConditions are Premium Only!**
In-line target conditions allow you to apply conditions to your targeters so that you only target the exact entity / location you are looking for. First lets look at the formatting of it.
In this example a mob would deal 1 damage to any players within 10 blocks that have the aura ``Plagued`` every second.
```yaml
SkeletalKnight:
Type: WITHER_SKELETON
Skills:
- damage{a=1} @PIR{r=10;conditions=[ - hasaura{aura=Plagued} true ]} ~onTimer:20
```
The spacing is crucial for in-line target conditions. Notice that there is two spaces between ``conditions=[`` and ``- hasaura{aura=Plagued} true``. You need to have that double space there.
Also notice that there is one space from ``true`` to ``]}`` and that space needs to be there as well.
You can also use multiple conditions on a single targeter, there is 2 ways of doing this.
Example of droping down a line and indenting:
```yaml
SkeletalKnight:
Type: WITHER_SKELETON
Skills:
- damage{a=1} @PIR{r=10;conditions=[
- hasaura{aura=Plagued} false
- haspotioneffect{type=WITHER;d=1to999999;l=0to254} true
]} ~onTimer:20
```
Note that there is still a space after the true at the end of the second condition.
Example of keeping multiple conditions on one line:
```yaml
SkeletalKnight:
Type: WITHER_SKELETON
Skills:
- damage{a=1} @PIR{r=10;conditions=[ - hasaura{aura=Plagued} true - haspotioneffect{type=WITHER;d=1to999999;l=0to254} true ]} ~onTimer:20
```
Note that there is two spaces between ``conditions=[`` and the first condition, then there is also two spaces between the first condition and the second condition. Finally there is still one space after the true at the end of the second condition.
\ No newline at end of file
Clone repository
Home
Changelogs
Premium Features
Commands and Permissions
Mythic Add-ons
Compatible Plugins
API Information
Guides
  • Troubleshooting
  • FAQ / Common Issues
  • Examples
Packs
Mobs
  • Mob Options
    • Display Options
  • Mob Levels
  • Mob Factions
  • Power Scaling
  • Damage Modifiers
  • Equipment
  • BossBar
  • Custom AI
  • Custom Kill Messages
  • Threat Tables
  • Immunity Tables
  • Templates
  • Vanilla Overrides
  • Extra: Disguises
  • Extra: ModelEngine
Skills
  • Mechanics
  • Targeters
    • Filters
  • Triggers
  • Conditions
    • In-line conditions
  • Metaskills
  • Placeholders
  • Variables
Items
  • Options
  • Attributes
  • Enchantments
  • Potions
  • Banner Layers
  • Firework
Drops & DropTables
  • Drops
  • DropTables
  • FancyDrops
Spawning
  • Spawners
  • Random Spawns
Stats
  • Custom Stat Options
  • Modifiers
  • Built in Stats
Technical
  • Math
  • Operations
    • Attribute Operations
    • Stats Modifiers
  • Particles Types
  • Audience
  • Equipment Slots
  • SkillTree
  • Intratick Scheduling
  • Dynamic Metaskills
Other
  • Pins