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 132
    • Issues 132
    • 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
  • Math

Last edited by Ticxo Mar 06, 2025
Page history
This is an old version of this page. You can view the most recent version or browse the history.

Math

Lets you make simple or advanced calculations. Any placeholders that returns a number is supported. You can use math in most places that supports placeholders.

  • Operators
    • Math Operators
    • Boolean Operators
  • Functions
  • Example Usage

Operators

Most of these operators can be found here https://www.objecthunter.net/exp4j/#Built-in_operators

Math Operators

Operator Description Example
+ Unary plus 2 + 2
- Unary minus 2 - 2
* Multiplication 2 * 2
/ Division 2 / 2
^ Power 2 ^ 2
% Remainder 2 % 2

Boolean Operators

Operators Description Example
< Less than 2<5
<= Less than or equal to 2<=5
> Greater than 5>1
>= Greater than or equal to 5>=0
== Equals 0==0

Boolean operators will return 1 if the expression is true and 0 if it's false.

Functions

Most of these functions can be found here https://www.objecthunter.net/exp4j/#Built-in_functions

Function Description
abs(x) the absolute value of (x)
acos(x) arc cosine
asin(x) arc sine
atan(x) arc tangent
cbrt(x) cubic root
ceil(x) nearest upper integer
cos(x) cosine
csch(x) hyperbolic cosecant
exp(x) euler's number raised to the power (e^x)
floor(x) nearest lower integer
log(x) logarithmus naturalis (base e)
log2(x) logarithm to base 2
log10(x) logarithm to base 10
logb(x) logarithm to base b
sec(x) secant
sech(x) hyperbolic secant
sin(x) sine
sinh(x) hyperbolic sine
sqrt(x) square root
tan(x) tangent
tanh(x) hyperbolic tangent
signum(x) signum of a value
toradian(x) converts from degrees to radians
todegree(x) converts from radians to degrees
min(x, y) minimum
max(x, y) maximum
atan2(y, x) principal value of the arc tangent of y/x, expressed in radians
random(min, max) random with limits
clamp(min, max, value) Clamps a number between a given minimum and maximum. If the number you provide is less than the minimum, it will return the minimum. If it's greater than the maximum, it returns the maximum. If it's between the minimum and maximum, it returns the number unchanged

NOTE: You can request to add more operators and functions by making a suggestion ticket in our issues page

Example Usage

MyCoolMob:
  Type: HUSK
  AIGoalSelectors:
    - clear
  AITargetSelectors:
    - clear
  Skills:
    - skill{s=[
      - setvar{var=skill.test;type=FLOAT;val="<caster.hp> <= <caster.mhp>"} #returns 1 or 0 if the mob's health is less than or equal to its max health
      - message{m=<skill.var.test>} #sends the player a message to see the value
      ]} @trigger ~onInteract
MyCoolItem:
  Id: STICK
  Skills:
    - skill{s=[
        - setvar{var=skill.test;type=FLOAT;val="1>=0"} #returns 1 since the expression evaluates to true
        - message{m=<skill.var.test>} #sends the player a message to see the value
      ]} @Self ~onUse
Clone repository
Home
Changelogs
Premium Features
Commands and Permissions
Mythic Add-ons
Compatible Plugins
API Information

Guides
  • Troubleshooting
  • FAQ / Common Issues
  • Examples
Packs

MythicScribe MythicScribe - VSCode Extension

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
    • Mechanics by Tag
  • 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

Other
  • Particles Types
  • Audience
  • Equipment Slots
  • Pins
Technical
  • Math
  • Operations
    • Attribute Operations
    • Stats Modifiers
  • SkillTree
  • Advanced User Guides and Techniques