-
-
Notifications
You must be signed in to change notification settings - Fork 78
AdvancedPriority Rewards
AdvancedPriority is an advanced reward-selection system available in AdvancedCore and used by plugins like VotingPlugin. It allows you to create a list of subβrewards under a single reward entry. When the reward is processed, the system walks through these subβrewards in order and executes the first one that meets all of its conditions. Conditions can include permissions, chance percentages and any other reward requirement supported by AdvancedCore. This design makes it easy to offer different rewards based on a playerβs rank or luck without creating multiple separate reward files. The documentation emphasises that AdvancedPriority checks rewards in order of rarest to most likely and stops at the first matchγ436168832069236β L192-L195γ.
- You define a primary reward (either in a reward file or inline in a config like
VoteSites.yml) and include anAdvancedPrioritysection inside itsRewardsblock. - Each key under
AdvancedPrioritybecomes a subβreward. Give each subβreward a unique name. - Assign any requirements to these subβrewards (permissions, chance, JavaScript expressions, etc.). If the first subβreward fails its requirements, the next one is evaluated. This continues until a subβreward succeeds.
- If none of the subβrewards succeed, you can provide a fallback reward as the last entry so the player still receives something.
The system lets you structure rewards so that the most exclusive or rare outcome is attempted first, followed by more common onesγ436168832069236β L192-L195γ. This avoids duplicating reward files and keeps all logic in one place.
You can use AdvancedPriority to give different rewards based on permissions. In the example below, the plugin will check whether the player has permhere; if so, it runs Reward1 and stops. If not, it checks for permhere2. If neither permission is present, the normal reward (money) is givenγ436168832069236β L199-L214γ.
Rewards:
AdvancedPriority:
# first subβreward: only runs if the player has permhere
Reward1:
RequirePermission: true
Permission: 'permhere'
Commands:
- say Reward1
# second subβreward: requires a different permission
Reward2:
RequirePermission: true
Permission: 'permhere2'
Commands:
- say Reward2
# fallback: give money if no permission matched
RewardNormal:
Money: 100Use this pattern to offer rankβspecific or permissionβbased perks without needing separate reward files. If you prefer to prevent a reward unless the player lacks a permission, prefix the permission with an exclamation mark (Permission: '!permhere').
AdvancedPriority also supports probabilistic rewards. You can assign a chance (out of 100) to each subβreward. The system will evaluate the subβrewards in order: if the first one fails its chance roll, the next one is attemptedγ436168832069236β L218-L231γ.
Rewards:
AdvancedPriority:
Reward1:
Chance: 60
Commands:
- say Reward1
Reward2:
Chance: 30
Commands:
- say Reward2
# fallback runs if neither chance succeeded
RewardNormal:
Money: 100In this example, there is a 60Β % chance to get the first reward, a 30Β % chance to get the second reward, and if both fail the player receives RewardNormal. Order matters: place the highest chance later so rare rewards are evaluated first.
You can also give different items with varying chances. This example demonstrates three tiers: a rare diamond, a common iron ingot and a fallback dirt reward. Each subβreward includes its own Items section and Chanceγ436168832069236β L233-L252γ.
AdvancedPriority:
Reward1:
Items:
Item1:
Material: DIAMOND
Amount: 1
Chance: 5
Reward2:
Items:
Item1:
Material: IRON_INGOT
Amount: 10
Chance: 50
Fallback:
Items:
Item1:
Material: DIRT
Amount: 64The player first has a 5Β % chance to receive the diamond, then a 50Β % chance for iron. If both chances fail, the fallback dirt is delivered. You can extend this pattern with additional subβrewards.
If you want to weight rewards based on rarity without specifying low percentages manually, you can arrange the subβrewards from rarest to most common. The following example shows a Rarest, SecondRarest and Fallback tierγ436168832069236β L255-L276γ.
AdvancedPriority:
Rarest:
Chance: 1
Items:
item:
Material: DIAMOND
Amount: 5
Messages:
Player: 'You got rare item'
SecondRarest:
Chance: 5
Items:
item:
Material: DIAMOND
Amount: 1
Messages:
Player: 'You got second rare item'
Fallback:
Items:
item:
Material: DIRT
Amount: 1
Messages:
Player: 'You got normal item'Because the rewards are evaluated in order, players will only reach the SecondRarest or Fallback tiers if the rarer rewards fail their chance roll. This structure is ideal for lootβcrate style rewards.
AdvancedPriority can be placed in reward files (YAML files stored in the Rewards folder of AdvancedCore) or directly inside the Rewards section of a configuration file like VoteSites.yml. Here are two common approaches:
Create a YAML file (e.g. MyReward.yml) inside the Plugins/AdvancedCore/Rewards folder and add an AdvancedPriority section. You can then reference this reward by its file name (without the extension) from other plugins.
# MyReward.yml
Rewards:
AdvancedPriority:
VIPReward:
RequirePermission: true
Permission: 'server.vip'
Items:
Diamond:
Material: DIAMOND
Amount: 3
NormalReward:
Money: 50You may also define AdvancedPriority directly within a plugin configuration, such as VoteSites.yml in VotingPlugin. The syntax is the same; place AdvancedPriority under the Rewards section of the site configuration. The following snippet shows a vote site that gives a diamond if the 50Β % chance succeeds, then an emerald with a 20Β % chance, otherwise a fallback messageγ436168832069236β L218-L231γ.
VoteSites:
ExampleSite:
Enabled: true
ServiceSite: 'ExampleSite.com'
VoteURL: 'https://example.com/vote'
Rewards:
AdvancedPriority:
Reward1:
Chance: 50
Items:
Diamond:
Material: DIAMOND
Amount: 1
Reward2:
Chance: 20
Items:
Emerald:
Material: EMERALD
Amount: 1
Fallback:
Messages:
Player: 'Better luck next time!'
# You can still define other rewards here; they run after AdvancedPriority
Items:
item1:
Material: COAL
Amount: 1- Order matters β always list the rarest or most exclusive rewards first and put common or fallback rewards lastγ436168832069236β L192-L195γ.
-
Unique names β ensure each subβreward name under
AdvancedPriorityis unique to avoid configuration conflicts. - Include a fallback β adding a fallback reward ensures players always receive something if earlier rewards fail.
- Combine with requirements β you can combine chance with other requirements such as permissions, world restrictions or JavaScript expressions. If any requirement fails, the system moves on to the next reward.
-
Use
&color codes β when adding messages in reward files, remember to use Minecraft color codes (e.g.&afor green) if you want colored text.
AdvancedPriority provides a flexible way to manage complex reward logic within AdvancedCore and associated plugins. By listing subβrewards in order, you can create tiered loot tables, rankβbased rewards and fallback strategies without duplicating reward files. Use the examples above as a starting point and adjust the chances, permissions or item lists to fit your serverβs needs.
- VoteMilestones
- Vote Streak System
- VoteReminders
- Vote Broadcast System
- Vote Logging
- Webhooks
- Time Changes
- Month Date Totals
- Rewards Overview
- Reward System
- Reward File
- Where to Set Rewards
- All Reward Possibilities
- Reward Examples
- Delayed Reward Command
- World Example
- VotingPlugin Specific Rewards
- Commands & Permissions
- API
- PlaceHolderAPI Placeholders
- Minecraft Server Lists
- Bedrock Player Support
- Transferring Data Storage