Conditions
RocketPlaceholders’ conditions system allows you to create dynamic placeholders that change based on various criteria. This is the recommended way to create advanced placeholders.Overview
With conditions, you can create placeholders that display different text based on:- Player permissions
- Player money/balance
- Items in inventory
- Player groups
- JavaScript expressions
- And more!
How Conditions Work
Conditions are evaluated in order, and the first matching condition will be used. This allows you to create priority-based placeholder systems.Creating a Condition
Here’s a basic example of how to create a custom condition:- Players without the permission see: “This is an example”
- Players with
rocketplaceholder.examplepermission see: “Example condition”
Available Condition Types
RocketPlaceholders supports the following condition types:Permission Condition
Check if a player has a specific permission node. Type:PERMISSIONRequires: Value (permission node) See the Permission Condition guide for details.
Money Condition
Check if a player has a certain amount of money (requires Vault and an economy plugin). Type:MONEYRequires: Value (numeric amount) See the Money Condition guide for details.
Item Condition
Check if a player has a specific item in their inventory. Type:ITEMRequires: Material and optional name/lore See the Item Condition guide for details.
Group Condition
Check if a player is in a specific group (requires Vault and a permissions plugin). Type:GROUPRequires: Value (group name) See the Group Condition guide for details.
JavaScript Condition
Use JavaScript expressions for complex logic (requires JShader). Type:JAVASCRIPTRequires: Value (JavaScript expression) See the JavaScript Condition guide for details.
Priority System
Conditions are evaluated in the order they appear in the configuration. The first matching condition will be used. Example:server.vip and server.premium permissions, they will see “VIP” because it’s listed first.
Complete Example
Here’s a comprehensive example using multiple condition types:Requirement Types Reference
You can view all available requirement types in the RocketPlaceholders source code.Best Practices
- Order matters - Place higher priority conditions first
- Use descriptive names - Name your conditions clearly (e.g.,
vip,admin,rich_player) - Combine condition types - Mix different condition types for complex logic
- Test thoroughly - Always test your conditions with different player scenarios
Related Guides
- Permission Condition - Permission-based conditions
- Money Condition - Money/balance conditions
- Item Condition - Item-based conditions
- Group Condition - Group-based conditions
- JavaScript Condition - JavaScript expression conditions