๐Ÿ’š
Treasure Particles
  • Home Page
  • Discord Server
  • Download
    • ๐ŸงกBuiltByBit
  • Effects
    • Basic Usage
    • Creating Effect
      • Caching
      • Variables
      • Tick Handlers
        • Events
        • Mixer Options
      • Script Types
        • Variable
        • Variable Cycle
        • Particle
          • Single Particle
          • Circle Particle
            • Spread Particle
            • Targeted Circle Particle
          • Spiral Effects
            • Spiral Particle
            • Multi Spiral Particle
            • Full Spiral Particle
          • Targeted Particle
          • Sphere Particle
          • Text Particle
            • Animated Text Particle
          • Particles
          • Color Format
        • Parkour
        • Condition
        • Preset
        • Sound
        • Message
          • Chat Message
          • Action Bar Message
          • Title Message
        • Lightning
        • Others
    • Presets
    • Mixer
    • Static Effects
  • Colors
    • Adding New Color Scheme
    • Adding New Color Group
  • Configuration
    • General Options
    • Database
    • Permissions
    • GUI Config
      • Item Properties
  • Translations
Powered by GitBook
On this page
  • Description
  • Example
  • Pre-defined Variables
  • Player-related variables
  1. Effects
  2. Creating Effect

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

effects:
  rainbow-circle:
    display-name: "%rainbow-circle%"
    color-animation: "rainbow"
    permission: "%rainbow-effects%"
    variables: [ 'r', 'x', 'y' ]

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.

Variable
Description
Aliases

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

Variable
Description
Aliases

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

*

PreviousCachingNextTick Handlers

Last updated 3 months ago

: magnitude of the vector squared

veloticyLength