Utility Commands
If you edit the commands in-game don't add the - that is before all examples.
DELAY
- Info: Delays a command line for seconds 
- Command: DELAY {amount} - {amount}: To how long you want commands to be delayed (In seconds) 
 
- Example: 
activators:
  activator0: # Activator ID, you can create as many activator on the activators list
    commands: #There will be a delay of 10 seconds between the command1 and the command2.
    - command1
    - DELAY 10
    - command2DELAY_TICK
- Info: Delays a command line for game ticks (20 ticks = 1 second) 
- Command: DELAY_TICK {amount} - {amount}: To how long you want commands to be delayed (In ticks) 
 
- Example: 
activators:
  activator0: # Activator ID, you can create as many activator on the activators list
    commands:
    - command1
    - DELAY_TICK 5 # (0.25 seconds)
    - command2IF
- Info: Executes commands if condition is met 
- Command: IF {condition_without_spaces} {command1} <+> {command2} <+> ... - {condition_without_spaces}: The condition for the IF to decide whether it runs or not. - Symbols: =, !=, >=, <=, >, < 
- It supports () for priority , && for AND and || for OR 
 
- {command1},{command2}: The commands that will be executed 
 
- Example: 
activators:
  activator0: # Activator ID, you can create as many activator on the activators list
    commands:
    - IF %player_health%>20 say coolactivators:
  activator0: # Activator ID, you can create as many activator on the activators list
    commands:
    - IF %entity%=PIG say I'm a pig <+> SETBABY <+> say I'm now a baby pigactivators:
  activator0: # Activator ID, you can create as many activator on the activators list
    commands:
    - IF 1=1||2=3 BACKDASH 1 # 1=1 OR 2=3 -> YES because 1=1
    - IF 1=1&&2=2||2=3 BACKDASH 1 # 1=1 and 2=2 or 2=3 -> YES because 1=1 and 2=2
    - IF (1=1&&2=2)||(2=3||3=2) BACKDASH 1 # (1=1 and 2=2) or (2=3 or 3=2) -> YES because 1=1 and 2=2WHILE
- Info: Repeats indefinitely as long as the condition is met. It is also running in async 
- Command: WHILE {condition_without_spaces} {delay_in_ticks} {command1} <+> {command2} <+> ... - {condition_without_spaces}: The condition for the while loop to decide whether it continues or stops 
- {delay_in_ticks}: The delay before the next repetition - Delay supports decimals value but they are casted to the next integer (20.1 -> 20) 
 
- {command},{command2}: The commands that will be executed in repeat 
 
- Example: 
activators:
  activator0: # Activator ID, you can create as many activator on the activators list
    commands:
    - WHILE %player_health%>10 20 SEND_MESSAGE &eHello &6While <+> minecraft:effect give %player% speed 1 1LOOP
- LOOP_START - Info: First part of the command 
- Command: LOOP_START loopCount:{number} - {number}: Number of times a command gets repeated. Placeholders are supported 
 
 
- LOOP_END - Info: Last part of the command 
- Command: LOOP_END 
 
- Example: (This is what you will see on config) 
activators:
  activator0: # Activator ID, you can create as many activator on the activators list
    commands:
    - 'RANDOM_RUN selectionCount:1'
    - 'LOOP_START loopCount:5' # (50%)
    - SEND_MESSAGE &cYOU GOT AN APPLE! +++ minecraft:give %player% apple 1
    - LOOP_END
    - 'LOOP_START loopCount:3' # (30%)
    - SEND_MESSAGE &7YOU GOT IRON! +++ minecraft:give %player% iron_ingot 1
    - LOOP_END
    - 'LOOP_START loopCount:2' # (20%)
    - SEND_MESSAGE &aYOU GOT DIAMOND! +++ minecraft:give %player% diamond 1
    - LOOP_END
    - RANDOM_ENDThis is what the ExecutableItems plugin sees when it runs
activators:
  activator0: # Activator ID, you can create as many activator on the activators list
    commands:
    - 'RANDOM_RUN selectionCount:1'
    - SEND_MESSAGE &cYOU GOT AN APPLE! +++ minecraft:give %player% apple 1
    - SEND_MESSAGE &cYOU GOT AN APPLE! +++ minecraft:give %player% apple 1
    - SEND_MESSAGE &cYOU GOT AN APPLE! +++ minecraft:give %player% apple 1
    - SEND_MESSAGE &cYOU GOT AN APPLE! +++ minecraft:give %player% apple 1
    - SEND_MESSAGE &cYOU GOT AN APPLE! +++ minecraft:give %player% apple 1
    - SEND_MESSAGE &7YOU GOT IRON! +++ minecraft:give %player% iron_ingot 1
    - SEND_MESSAGE &7YOU GOT IRON! +++ minecraft:give %player% iron_ingot 1
    - SEND_MESSAGE &7YOU GOT IRON! +++ minecraft:give %player% iron_ingot 1
    - SEND_MESSAGE &aYOU GOT DIAMOND! +++ minecraft:give %player% diamond 1
    - SEND_MESSAGE &aYOU GOT DIAMOND! +++ minecraft:give %player% diamond 1
    - RANDOM_ENDExplanation:
When the plugin runs the commands, it duplicates the commands inside the loop commands to reduce the number of command lines in your config to make your config cleaner and since RANDOM_RUN gives each command equal rates, the estimated rate will be:
- 50% chance to get an apple 
- 30% chance to get iron 
- 20% chance to get diamond 
FOR - END_FOR
- Command that allows you to target multiple elements inside a list 
activators:
  activator0: # Activator ID, you can create as many activator on the activators list
    commands:
    - FOR [Special70, Ssomar, Vayk] > for1
    - effect give %for1% speed 60 2
    - END_FOR for1activators:
  activator0: # Activator ID, you can create as many activator on the activators list
    commands:
    - FOR [Special70, Ssomar, Vayk] > for2
    - FOR [5,4,3,2,1] > for3
    - SEND_MESSAGE >> &e%for2% &a%for3%
    - END_FOR for3
    - END_FOR for2
activators:
  activator0: # Activator ID, you can create as many activator on the activators list
    commands:
    - FOR %score_variables_myList% > for4
    - minecraft:effect give %for4% speed 60 2
    - END_FOR for4Run commands randomly ?
RANDOM_RUN / RANDOM_END
- Info: A command mainly used for RNG. 
- RANDOM_RUN - Info: The first part of the command 
- Command: RANDOM_RUN selectionCount:{amount} - selectionCount: The amount of commands that will be randomly selected inside of the command line. Placeholders are supported 
 
 
- RANDOM_END - Info: The other part of the command 
- Command: RANDOM_END 
 
To be able to run multiple commands in one command line inside the RANDOM part use +++
- Example: 
activators:
  activator0: # Activator ID, you can create as many activator on the activators list
    commands:
    - 'RANDOM_RUN selectionCount:1'
    - minecraft:give %player% coal 1
    - minecraft:give %player% iron_ingot 1
    - minecraft:give %player% gold_ingot 1
    - RANDOM_ENDThis means that you have a 1/3 chance of getting coal, iron or gold
activators:
  activator0: # Activator ID, you can create as many activator on the activators list
    commands:
    - 'RANDOM_RUN selectionCount:2'
    - minecraft:give %player% diamond 1 +++ SEND_MESSAGE &aYou receive &b1 Diamond
    - minecraft:give %player% emerald 1 +++ SEND_MESSAGE &aYou receive &21 Emerald
    - minecraft:give %player% diamond_block 1 +++ SEND_MESSAGE &aYou receive &b1 Diamond block
    - RANDOM_ENDThis means that from the 3 give commands, 2 of the randomly chosen command lines will run.
activators:
  activator0: # Activator ID, you can create as many activator on the activators list
    commands:
    - 'RANDOM_RUN selectionCount:1'
    - NOTHING*9
    - minecraft:give %player% diamond_block 1
    - RANDOM_ENDThis means that there's a 10% chance to give you a diamond block.
NOTHING*
- Info: Mainly used for RANDOM_RUN commands as a "dummy" command for RNG adjustments 
- Command: NOTHING*{amount} 
- Example of usage: 
activators:
  activator0: # Activator ID, you can create as many activator on the activators list
    commands:
    - 'RANDOM_RUN selectionCount:1'
    - NOTHING*99
    - minecraft:give %player% diamond 1
    - RANDOM_ENDThis command line means that there is a 1/100 chance it will give you a diamond
More Examples:
- I want to make it so 99% chance it will give me dirt and 1% chance to give me diamond BUT I don't want to write 99 lines of the give dirt command. 
- So here is how to do it. 
activators:
  activator0: # Activator ID, you can create as many activator on the activators list
    commands:
    - 'LOOP_START loopCount:99' 
    - minecraft:give %player% dirt 1
    - LOOP_END- The 99 represents that any commands inside the loop command will be duplicated 99 times. You will only see the give command and the loop command but the plugin sees 99 give commands. 
- Here is what the plugin sees 
activators:
  activator0: # Activator ID, you can create as many activator on the activators list
    commands:
    - minecraft:give %player% dirt 1
    - minecraft:give %player% dirt 1
    - minecraft:give %player% dirt 1
    - minecraft:give %player% dirt 1
    - minecraft:give %player% dirt 1
    - minecraft:give %player% dirt 1
    - minecraft:give %player% dirt 1
    - minecraft:give %player% dirt 1
    - minecraft:give %player% dirt 1
    - minecraft:give %player% dirt 1(You get the idea.)
- So let's go back to our main objective. 99% chance to get dirt, 1% chance to get diamond. The RANDOM_RUN command evenly gives the same RNG rates to all the commands inside the RANDOM_RUN command. 
The (5%) percentage stuff is not part of the command. It's written here in the wiki for you to acknowledge the chances for that command to be selected from the list of commands
activators:
  activator0: # Activator ID, you can create as many activator on the activators list
    commands:
    - 'RANDOM_RUN selectionCount:1'
    - minecraft:give %player% dirt #(1/2 = 50%)
    - minecraft:give %player% diamond #(1/2 = 50%)
    - RANDOM_ENDactivators:
  activator0: # Activator ID, you can create as many activator on the activators list
    commands:
    - 'RANDOM_RUN selectionCount:1'
    - minecraft:give %player% dirt #(1/3 = 33%)
    - minecraft:give %player% diamond #(1/3 = 33%)
    - minecraft:give %player% diamond #(1/3 = 33%)
    - RANDOM_ENDactivators:
  activator0: # Activator ID, you can create as many activator on the activators list
    commands:
    - 'RANDOM_RUN selectionCount:1'
    - minecraft:give %player% dirt #(1/4 = 25%)
    - minecraft:give %player% dirt #(1/4 = 25%)
    - minecraft:give %player% diamond #(1/4 = 25%)
    - NOTHING*1 #(1/4 = 25%)
    - RANDOM_END- After seeing these RANDOM_RUN examples, we will acknowledge that it would work like this. 
activators:
  activator0: # Activator ID, you can create as many activator on the activators list
    commands:
    - 'RANDOM_RUN selectionCount:1'
    - 'LOOP_START loopCount:99' 
    - minecraft:give %player% dirt 1  #(99/100 = 99%)
    - LOOP_END
    - minecraft:give %player% diamond 1 #(1/100 = 1%)
    - RANDOM_END- The total of the supposed lines is 100 so it's going to be (100 command lines / 100% = 1%) rate per command. 
Last updated
