Custom Placeholders
RocketPlaceholders allows you to create custom placeholders that can be used with PlaceholderAPI and MVdWPlaceholderAPI. This guide will teach you how to create your own placeholders.Overview
Custom placeholders are stored in theplaceholders folder. Each placeholder is defined in its own YAML file with a unique identifier.
Creating a Basic Placeholder
To create a custom placeholder, create a new file in theplaceholders folder with the following structure:
Placeholder Format
- PlaceholderAPI:
%rp_<name>%(e.g.,%rp_test%) - MVdWPlaceholderAPI:
{rp_<name>}(e.g.,{rp_test})
<name> is the value you set in the placeholder field.
Public Placeholders
A public placeholder is visible to everyone with the same text:%rp_welcome%.
Permission-Based Placeholders
You can create placeholders that show different text based on permissions:- Players without
example.1permission see: “This is a test” - Players with
example.1permission see: “this is a secret test!”
Examples
Example 1: Simple Welcome Message
Example 2: Permission-Based Secret Message
Example 3: Multiple Placeholders
You can define multiple placeholders in the same file:Using JavaScript Expressions
You can use JavaScript expressions for placeholder text (requires JShader):Placeholder Identifiers
Good:Best Practices
-
Use descriptive names - Choose placeholder names that clearly indicate their purpose (e.g.,
welcome,server_name,player_count) - Organize by purpose - Group related placeholders together or create separate files for different categories
- Document your placeholders - Add comments in your YAML files to explain what each placeholder does
- Test thoroughly - Always test your placeholders in-game to ensure they work as expected
- Use conditions for complex logic - For more advanced logic, use conditions instead of just permissions
Advanced: Using Conditions
For more complex placeholder logic, you can use conditions:Troubleshooting
Q: My placeholder isn’t showing upA: Make sure:
- The placeholder identifier is not
0 - The file is in the
placeholdersfolder - You’ve restarted the server or reloaded the plugin
- PlaceholderAPI is installed and working
A: Check that:
- The permission node is correct
- Players actually have the permission
- The
text_with_permissionfield is set
%rp_name% instead of the textA: This usually means PlaceholderAPI isn’t detecting the placeholder. Make sure:
- PlaceholderAPI is installed and enabled
- RocketPlaceholders is properly installed
- You’re using the correct placeholder format
Related Guides
- Configuration - Plugin configuration
- Conditions - Advanced placeholder conditions
- Custom Permissions - Legacy permission system (deprecated)