-
Notifications
You must be signed in to change notification settings - Fork 0
Custom Conditions
Use skfunction as a MythicMobs condition and return a Skript boolean.
ConditionalSkill:
Skills:
- message{m="Condition passed"} @target ?skfunction{name=is_valid_target}name and n are accepted aliases. Load the Skript function before loading or
reloading the MythicMobs configuration.
A custom condition must return boolean. The accepted parameter signatures
determine the MythicMobs condition type:
| Skript signature | Registered condition |
|---|---|
one entity parameter |
Entity condition |
one location parameter |
Location condition |
two entity parameters |
Entity comparison condition |
two location parameters |
Location comparison condition |
entity, location |
Entity/location comparison condition |
location, entity |
Entity/location comparison condition with reversed argument order |
Use exactly one or two parameters. If the function returns nothing or a
non-boolean value, the condition resolves to false.
Concrete entity subtypes such as player are recognized when MythicMobs loads
the condition, but the current condition bridge does not perform the strict
runtime subtype validation provided by the skfunction mechanic. Use entity
and check its subtype inside the function when a condition may receive mixed
targets.
function is_valid_target(target: entity) :: boolean:
return whether {_target} is a playerfunction same_world(caster: entity, target: entity) :: boolean:
return whether world of {_caster} is world of {_target}The first and second values are supplied by MythicMobs according to the condition context.
Home
Documentation
Advanced Integrations