# Functions

Functions are tags which can be used in effect lines to make them more dynamic. They are written in `<>`

brackets and are used instead of a value for the effect.

Here is a list of available functions:

`<chance>`

`<chance>`

Sets a chance for this effect line to activate. The number inside the brackets is the percentage chance of the effect activating.

Example:

This will cause the entity to take 5% more damage 50% of the time.

`<condition>`

`<condition>`

Use in-line conditions for effects. Extremely handly to create dynamic mechanics.

Example:

This would add 2.5 hearts to victim's health if they had less than 5 hearts remaining.

`<math>`

`<math>`

Performs a math operation using variables or numbers. The operation is written inside the brackets.

Example:

This will drop double the amount of experience from event.

`<random number>`

`<random number>`

Picks a random number between two values. The values are written inside the brackets and separated by a dash `-`

.

Example:

This will increase the damage to a random amount between 1 and 5.

`<random word>`

`<random word>`

Picks a random word from a list. The words are written inside the brackets and separated by a comma `,`

.

Example:

This will send a message with a random word from the list.

`<round>`

`<round>`

Rounds a number to the nearest whole number. The number is written inside the brackets.

Example:

This will give the entity an amount of experience that is 2.5 times their current amount, rounded to the nearest whole number.

**<int>**

**<int>**

Converts a floating-point number to an integer by removing any fractional parts. The number to be converted is written inside the brackets.

**Example:**

`effects:`

`'EXP:<int><math>%exp% * 1.5</math></int>'`

In this example, if the entity has an experience value (`%exp%`

), multiplying it by 1.5 might result in a floating-point number. The `<int></int>`

tags ensure that the final experience value given to the entity is an integer by removing any decimals.

**<scramble>**

** **

**<scramble>**

Randomly rearranges the characters within the text placed inside the brackets. This can be used to create scrambled text effects.

**Example:**

`effects:`

`'Message:<scramble>Welcome!</scramble>'`

In this example, the text "Welcome" will be scrambled into a random arrangement, such as "cme!lWe!" (Note: The actual scrambled output will vary each time it's generated.)

Last updated