UltimateRewards Wiki
  • Getting started
    • Support
  • Addons
  • Configs
    • Player Levels
    • Referrals
    • Loginstreak
  • USAGE
    • Installation
    • Commands
  • configuration
    • Rewards
      • Creating Reward
      • Reward Types
        • Afk Reward
          • World Afk Reward
          • Area Afk Reward
          • Region Afk Reward
        • Advent Calendar
        • Pickable Reward
        • Time Reward
        • Time Fixed Reward
        • Streak Reward
        • Streak Fixed Reward
        • Vote Reward
        • Renewable Vote Reward
        • Per Vote Reward
        • Streak Vote Reward
        • Play Time Reward
        • Renewable Play Time Reward
        • Referral Reward
        • Renewable Referral Reward
        • Purchasable Reward
        • Re-Purchasable Reward
        • One Time Reward
        • Time Limited Reward
        • Custom Reward
        • Multiple Custom Reward
        • Coupon Reward
        • Discord Reward
      • Reward Settings
      • Reward Actions
      • Reward Features
        • Auto Claim
        • Notifications
        • Reward NPC
        • Discord Support
        • Reward Requirements
        • Reward Variants
        • Selectable Rewards
        • Randomization
          • Execution Chances
          • Random Placeholders
        • AFK Checkers
        • Leaderboards
    • Menus
      • Basics
      • Example of GUIs
      • Setting Menu
    • Schedules & Timers
  • Colors & Models
  • Placeholders
  • API
    • Events
    • Examples
    • Setting up own playtime calculator
  • Policies
    • TOS
Powered by GitBook
On this page
  1. configuration
  2. Rewards
  3. Reward Features
  4. Randomization

Random Placeholders

Randomization refers to the ability to create custom placeholders (in the "randoms.yml" file) where you specify a numerical range from which a random number will be selected during command execution.

Let's consider this example configuration:

placeholders:
   exampleRandom: 16-64 # Will return random number between 16 - 64
   anotherRandom: 10-10000 # Will return random number between 10 - 10,000

Now we can use the specified placeholders in the actions of any reward. Here's a demonstration example:

Suppose we have a reward called "Welcome Bonus" which gives the player a certain amount of apples. We want the amount of apples to be randomized within a certain range using the exampleRandom placeholder we defined earlier.

enabled: true
type: one_time_reward
disappear: false
use-firework: true
permission: ultimaterewards.welcomeBonus
available-item: CHEST_MINECART
available-display-name: '&a&lWELCOME BONUS'
available-lore:
  - ' '
  - '&7Contains:'
  - '&e ➪ 16 - 64x Apple'
  - ' '
  - '&b► Click to claim'
unavailable-display-name: "&7&lWELCOME BONUS"
unavailable-lore:
  - '&7Welcome bonus was already'
  - '&7claimed.'
unavailable-item: MINECART
no-permission-item: BARRIER
no-permission-display-name: "&c&l&mWELCOME BONUS"
no-permission-lore:
  - "&c ✕ Locked, requires"
  - "&c   %permission% permission"
actions:
  - '[console] give %player% apple %exampleRandom%'
  - '[message] &aWelcome to the server, %player%! I hope these items will assist you in getting started.'

You can define as many custom placeholders as you need in the "randoms.yml" file, and use them in your commands to add some variability to your server gameplay.

PreviousExecution ChancesNextAFK Checkers

Last updated 10 months ago