Execution Chances

Individual chances

Each action line can be assigned a chance (0 - 100 represented as a percentage) at which the line will be executed.

Example

actions:
 - "[console] 20:give %player% obsidian 2" # 20%  chance
 - "[console] 60:give %player% coal 1"     # 80%  chance
 - "[console] give %player% apple 16"      # 100% chance

Group chances

Each action sections can be separated by percentages, where each percentage represents the probability that the corresponding section will be executed. The percentages determine how likely it is for a particular block of actions to run. When these sections are defined, the system will randomly select one of the sections based on their assigned probabilities.

Example

actions:
  80: # 80% chance for execution
    - '[console] give %player% diamond 1'
    - '[console] give %player% iron_ingot %exampleRandom%'
    - '[console] give %player% gold_ingot 3'
    - '[console] say %player% claimed his %type% reward!'
    - '[actionbar] &aSuccessfully claimed!'
    - '[title] &aClaimed'
    - '[subtitle] &aReward %type%'
  20: # 20% chance for execution
    - '[console] give %player% diamond 1'
    - '[console] give %player% iron_ingot %exampleRandom%'
    - '[console] give %player% gold_ingot 3'
    - '[console] say %player% claimed his %type% reward!'
    - '[actionbar] &aSuccessfully claimed!'
    - '[title] &aClaimed'
    - '[subtitle] &aReward %type%'
    - '[message] &a&lYou have been extra lucky today! Received 5 more diamonds!'
    - '[console] give %player% diamond 5'
    - '[console] 10:give %player% netherite_ingot 1' # Individual chances can be used aswell

Last updated