Skip to content

Custom Conditions

Yevhen Harasymchuk edited this page Jul 29, 2026 · 2 revisions

Use skfunction as a MythicMobs condition and return a Skript boolean.

MythicMobs Syntax

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.

Function Contracts

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.

Entity Example

function is_valid_target(target: entity) :: boolean:
    return whether {_target} is a player

Comparison Example

function 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.

Clone this wiki locally