💚
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
  • Format
  • Examples
  1. Effects
  2. Creating Effect
  3. Script Types

Condition

This page was last updated for version v1.2.0

PreviousParkourNextPreset

Last updated 3 months ago

Format

conditional (condition) ? execute-if-condition-is-true : execute-if-condition-is-false

Examples

  1. conditional (timer>=20) ? variable timer=0 : variable timer+=1

    Set the timer to 0 when the timer is greater than or equal to 20

    Add 1 to the timer when the timer is less than 20

  2. conditional (reverse==1 && x>90) ? variable reverse=0 : none

    Set reverse to 0 when reverse is equal to 1 and x is greater than 90

    Otherwise, do nothing

  3. conditional ((reverse==1 && x>90) || (reverse!=1 && x<0)) ? preset play-sound : none

    Play sound when (the reverse is equal to 1 and x is greater than 90) or (the reverse is not equal to 1 and x is less than 0)

    Otherwise, do nothing

You must put the conditions between ()

You cannot put a condition inside a condition but you can define a preset for that:

  • Create a preset in presets.yml (see )

  • In your condition, put the preset into the correct place

Example

presets.yml

reverse: "conditional (stepY>60) ? variable reverse=0 : none"

effects.yml

..
scripts:
  - "conditional (reverse==1) ? preset reverse : none"
..

You can add mathematical equations in conditions:

  • Put the variables inside {} to enable equations

Example

- "conditional ({TIMER}%20==0) ? preset reset-things : return"
Presets