Page cover

View Requirements

View Requirements & Priority System

Overview

The View Requirements and Priority system allows you to create dynamic, personalized shop menus that adapt to each player's permissions, rank, level, balance, and more. This powerful feature lets you show different items to different players in the same slot, creating a truly customized shopping experience.


Table of Contents

  • Priority System

  • View Requirements

  • Permission Requirements

  • Placeholder Requirements

  • Numeric Comparisons

  • JavaScript Expressions

  • Complete Examples

  • Best Practices


Priority System

What is Priority?

Priority determines which item displays when multiple items target the same inventory slot. The item with the highest priority value that meets its view requirements will be shown.

How It Works

  1. Default Priority: If not specified, items have a priority of 0

  2. Higher Wins: Items with higher priority values override lower ones

  3. Requirements First: Only items that meet their view requirements compete

  4. Dynamic Display: Different players see different items based on their status

Basic Priority Example

Result:

  • Default players see: basic_sword (priority 1)

  • VIP players see: vip_sword (priority 5 beats 1)

  • MVP players see: mvp_sword (priority 10 beats 5)


View Requirements

View requirements determine who can see an item. If a player doesn't meet the requirements, the item is completely hidden from their menu.

Basic Structure


Permission Requirements

Single Permission

Show an item only to players with a specific permission.

Multiple Permissions (OR Logic)

Show an item if the player has at least one of the listed permissions.

Result: Players with VIP, MVP, or Ultimate rank can see this item.


Placeholder Requirements

String Comparison (Equals)

Check if a placeholder equals a specific value.

String Comparison (Not Equals)

Check if a placeholder does not equal a specific value.

Result: Only players who are not in the "default" group can see this item.

Common Placeholders

Placeholder
Description
Plugin Required

%player_name%

Player's username

None

%player_level%

Player's level

None

%player_world%

Current world

None

%vault_eco_balance%

Player's balance

Vault

%luckperms_primary_group%

Player's rank

LuckPerms

%statistic_deaths%

Death count

None

%statistic_play_one_minute%

Playtime (minutes)

None

Important: PlaceholderAPI must be installed for most placeholders to work!


Numeric Comparisons

Compare numeric placeholder values using mathematical operators.

Comparison Operators

Operator
Alternative
Description

==

equals

Equal to

!=

not-equals

Not equal to

>

greater-than

Greater than

>=

greater-than-or-equals

Greater than or equal

<

less-than

Less than

<=

less-than-or-equals

Less than or equal

Level Requirement Example

Result: Only players level 50 or higher can see this item.

Balance Requirement Example

Result: Only players with $100,000+ can see this item.

Multiple Numeric Items (Priority + Level)

Result:

  • Level 1-24: See beginner_package

  • Level 25-49: See intermediate_package

  • Level 50+: See advanced_package


JavaScript Expressions

For complex conditions that require multiple checks or custom logic, use JavaScript expressions.

Basic Syntax

Supported Operations

  • Math: +, -, *, /, %

  • Comparison: >, <, >=, <=, ==, !=

  • Logical: && (AND), || (OR), ! (NOT)

  • Grouping: ( )

Example: Level AND Balance

Result: Player must be level 30+ AND have $50,000+

Example: Multiple Conditions with OR

Result: Player must either be level 100+ OR have $1,000,000+

Example: Complex Logic

Result: Show if (level 50+ AND $100k+) OR player is named "Admin"

{% hint style="danger" %} Warning: JavaScript expressions are evaluated on every menu open. Complex expressions may impact performance on large servers. {% endhint %}


Complete Examples

Example 1: Rank-Based Shop

Create a shop where items change based on player rank in the same slots.

Example 2: Progressive Level Shop

Items unlock as players level up.

Example 3: VIP Exclusive Section

Create items that only VIP+ members can see.

Example 4: Multi-Condition Items

Combine multiple requirements for complex conditions.

Example 5: Event-Based Items

Show items based on specific conditions (requires additional placeholders).


Best Practices

1. Use Priority Strategically

Tip: Use increments of 5 or 10 to leave room for future items.

2. Always Set Fallback Items

3. Test Requirements Thoroughly

  • Test with players of different ranks

  • Test with different level ranges

  • Test with varying balances

  • Use /sudo or alt accounts for testing

4. Document Your Requirements

5. Optimize Performance

Tip: Use simple permission/placeholder checks when possible. Reserve JavaScript for truly complex conditions.

6. Avoid Requirement Conflicts


Troubleshooting

Item Not Showing

  1. Check View Requirements: Use /papi parse me %placeholder% to test placeholder values

  2. Check Priority: Another item might have higher priority

  3. Check Permission: Verify player has required permissions

  4. Check Page: Ensure item is on correct page

Wrong Item Showing

  1. Verify Priority Values: Higher priority item might be meeting requirements

  2. Check Placeholder Values: Placeholders might not return expected values

  3. Test JavaScript: JavaScript expression might have logic errors


Additional Resources

  • PlaceholderAPI Wiki: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki

  • JavaScript Tutorial: https://www.w3schools.com/js/

  • Common Placeholders: /papi ecloud list all


Support

If you need help with view requirements or priority:

  1. Check this documentation thoroughly

  2. Test placeholder values with /papi parse me %placeholder%

  3. Contact support with your configuration and error logs

Pro Tip: Start simple and add complexity gradually. Test each requirement individually before combining them!

Last updated