Variables
This page was last updated for version v1.2.0
Description
The most important part of creating an effect with TreasureParticles is variables, as they allow you to create any desired type of effect. To use variables, it is necessary to first list all variables beforehand. Unlisted variables will result in errors.
When naming your variables, make sure that each variable has a unique name, does not contain special characters, and does not contain spaces. Variable names are case-sensitive.
You can give your variables a default value by adding name=<VALUE>
. Let's say you want to add a x variable and set the value of x to 5 by default, you can just add x=5
to the variables list.
Example
As seen in the example, we listed and defined the "r", "x", and "y" variables.
Pre-defined Variables
Some variables are predefined by the plugin. A variable with the same name as these predefined variables should not be used.
i
Loop timer
*
PI
3,14...
*
2PI
2 x PI
*
RANDOM
Random decimal between 0 to 1
*
RANDOM-
Random decimal between -1 to +1
*
TICK
Game tick
*
currentTimeMillis
Current time in milliseconds
CTM
lastBoostMillis
Last elytra boost time in milliseconds (Paper 1.17+ is required)
LBM
Player-related variables
isMoving
Returns 1 if player is moving, or else 0
*
isStanding
Returns 1 if player is standing, or else 0
*
playerYaw
Player's yaw (y-rot)
*
playerPitch
Player's pitch (x-rot)
*
playerX
Player's x location
*
playerY
Player's y location
*
playerZ
Player's z location
*
velocityX
Player's x vector
*
velocityY
Player's y vector
*
velocityZ
Player's z vector
*
veloticyLength
Player's vector length
*
veloticyLength: magnitude of the vector squared
Last updated