Skip to content

Generic โ€‹

Expression Check โ€‹

Use this condition to perform arithmetic and boolean calculations. You can use placeholders from PAPI returning true or false as well as logical operators (negation !, or ||, and &&) and MythicLib will parse and compute the result of your boolean formula.

This can be used to multiple compare numbers simultaneously, for instance using (a < b) && (c >= d). The brackets are not mandatory but can help with readability. You can add as many spaces as you want between the different parts of the formula for better clarity.

ParameterAliasDescriptionDefault
formulaform, f, expression, expr, eThe boolean formula to evaluate.-
yml
condition_generic_1:
  conditions:
  - 'boolean{formula=" (%mmocore_in_combat% || %mmocore_in_combat%) && true"}'
  mechanics:
  - 'message{format="You are in combat!"}'

condition_generic_2:
  conditions:
  - 'boolean{formula="(<caster.health> <= 10 && <caster.health> > 5) || (!%mmocore_in_combat%)"}'
  mechanics:
  - 'message{format="Condition met!"}'

Has Variable โ€‹

Checks if a variable exists. This can also be used against a reserved variable like target or target_location.

ParameterAliasDescriptionDefault
variablevar, v, name, nName of the variable to check for.-
yml
condition_has_variable:
  conditions:
  - 'has_variable{var=target_location}'
  mechanics:
  - 'message{format="The variable target_location exists!"}'

String Contain โ€‹

Use this condition to check if some string contains another string.

ParameterAliasDescriptionDefault
withininThe string to search in.-
searchlookfor, look, lfThe string to search for.-
ignore_caseicWhether to ignore case when comparing the strings.false

This example script checks if the target entity is either a Zombie or a Skeleton.

yml
condition_string_contain:
  conditions:
  - 'string_contains{in="ZOMBIE,SKELETON";look="<target.type>"}'
  mechanics:
  - 'message{format="Target is either a Zombie or a Skeleton!"}'

String Match โ€‹

Use this condition to check if two strings match exactly.

ParameterAliasDescriptionDefault
firstone, left, lhsThe first string.-
secondtwo, right, rhsThe second string.-
ignore_caseicWhether to ignore case when comparing the strings.false

This checks if the player is in a certain world:

yml
condition_string_eq:
  conditions:
  - 'string_equals{first="<target.location.world.name>";second="spawn"}'
  mechanics:
  - 'message{format="You are in the spawn world!"}'

Powered by VitePress