|
Lets you make simple or advanced calculations. Any placeholders that returns a number is supported.
|
|
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.
|
|
You can use math in most places that supports placeholders.
|
|
|
|
|
|
Operators
|
|
[[_TOC_]]
|
|
-----------
|
|
|
|
|
|
## Operators
|
|
Most of these operators can be found here https://www.objecthunter.net/exp4j/#Built-in_operators
|
|
Most of these operators can be found here https://www.objecthunter.net/exp4j/#Built-in_operators
|
|
#### Math Operators
|
|
### Math Operators
|
|
|
|
|
|
| Operator | Description | Example |
|
|
| Operator | Description | Example |
|
|
|:--------:|:----------------:|:---------:|
|
|
|:--------:|:----------------:|:---------:|
|
... | @@ -15,7 +16,7 @@ Most of these operators can be found here https://www.objecthunter.net/exp4j/#Bu |
... | @@ -15,7 +16,7 @@ Most of these operators can be found here https://www.objecthunter.net/exp4j/#Bu |
|
| ^ | Power | 2 ^ 2 |
|
|
| ^ | Power | 2 ^ 2 |
|
|
| % | Remainder | 2 % 2 |
|
|
| % | Remainder | 2 % 2 |
|
|
|
|
|
|
#### Boolean Operators
|
|
### Boolean Operators
|
|
| Operators | Description | Example |
|
|
| Operators | Description | Example |
|
|
|:---------:|:------------------------:|:-------:|
|
|
|:---------:|:------------------------:|:-------:|
|
|
| \< | Less than | 2<5 |
|
|
| \< | Less than | 2<5 |
|
... | @@ -27,8 +28,7 @@ Most of these operators can be found here https://www.objecthunter.net/exp4j/#Bu |
... | @@ -27,8 +28,7 @@ Most of these operators can be found here https://www.objecthunter.net/exp4j/#Bu |
|
*Boolean operators will return `1` if the expression is true and `0` if it's false.*
|
|
*Boolean operators will return `1` if the expression is true and `0` if it's false.*
|
|
|
|
|
|
|
|
|
|
Functions
|
|
## Functions
|
|
---------
|
|
|
|
Most of these functions can be found here https://www.objecthunter.net/exp4j/#Built-in_functions
|
|
Most of these functions can be found here https://www.objecthunter.net/exp4j/#Built-in_functions
|
|
|
|
|
|
| Function | Description |
|
|
| Function | Description |
|
... | @@ -61,12 +61,12 @@ Most of these functions can be found here https://www.objecthunter.net/exp4j/#Bu |
... | @@ -61,12 +61,12 @@ Most of these functions can be found here https://www.objecthunter.net/exp4j/#Bu |
|
| max(x, y) | maximum |
|
|
| max(x, y) | maximum |
|
|
| atan2(y, x) | principal value of the arc tangent of y/x, expressed in radians |
|
|
| atan2(y, x) | principal value of the arc tangent of y/x, expressed in radians |
|
|
| random(min, max) | random with limits |
|
|
| random(min, max) | random with limits |
|
|
|
|
| clamp(value, min, max) | 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](https://git.mythiccraft.io/mythiccraft/MythicMobs/-/issues)
|
|
NOTE: You can request to add more operators and functions by making a suggestion ticket in our [issues page](https://git.mythiccraft.io/mythiccraft/MythicMobs/-/issues)
|
|
|
|
|
|
|
|
|
|
Example Usage
|
|
## Example Usage
|
|
------------
|
|
|
|
```yml
|
|
```yml
|
|
MyCoolMob:
|
|
MyCoolMob:
|
|
Type: HUSK
|
|
Type: HUSK
|
... | | ... | |