This plugin is designed exclusively for development and testing environments. It should NEVER be used on production servers.
PlaceholderAPI Mock is a Spigot plugin that provides mock placeholder values for developers working on plugins that depend on PlaceholderAPI. Instead of setting up complex plugin ecosystems during development, you can quickly mock any placeholder values through simple configuration.
This plugin is perfect for:
- Plugin developers who need to test PlaceholderAPI integrations
- Multi-developer teams where not everyone needs full plugin setups
- Testing scenarios where you need predictable placeholder values
- Development environments where installing multiple plugins is impractical
- Easy Configuration: Define mock placeholders through a simple YAML configuration
- Dynamic Placeholder Support: Support for placeholders with dynamic parameters (e.g.,
%plugin_player_<player>%) - Multiple Identifiers: Mock placeholders from multiple different plugins simultaneously
- Runtime Reloading: Reload configuration without restarting the server
- Debug Mode: See all loaded mock placeholders in console for debugging
- Spigot/Paper 1.21+
- PlaceholderAPI (required dependency)
- Java 17+
- Download the latest release from the releases page
- Place the JAR file in your server's
plugins/folder - Make sure PlaceholderAPI is installed and enabled
- Start your server
- Configure mock placeholders in
plugins/PlaceholderAPIMock/config.yml - Reload the plugin with
/papimock reload
The plugin configuration is located at plugins/PlaceholderAPIMock/config.yml.
# Enable debug mode (shows all loaded placeholders in console)
debug: true
# Mock placeholder values configuration
mock_placeholders:
# Static placeholders
plugin_identifier_placeholder_name: "mock_value"
# Dynamic placeholders with variables
plugin_identifier_<variable>: "Value with {variable}"mock_placeholders:
# Economy plugin examples
vault_eco_balance: "9999999.99"
vault_eco_top_1: "RichPlayer123"
# Player data examples
playerdata_level: "50"
playerdata_exp: "1500"mock_placeholders:
# Single variable
vault_eco_balance_<player>: "Player {player} balance: 50000"
# Multiple variables
gamedata_player_<player>_<type>: "Player {player} {type}: 100"
# Complex patterns
stats_top_<rank>_<category>: "Rank {rank} in {category}: PlayerName"mock_placeholders:
# Placeholder names that contain literal < > characters
cwduration_general_\<cwgame_game_time\>: "15:30"
plugin_data_\<special_format\>: "Special data format"
# Mixed escaped and dynamic
test_\<prefix\>_<player>_suffix: "Prefix <prefix> for player {player}"You can use any variable name in angle brackets
Use {variable_name} in the value to reference the extracted variable.
If you need to include literal < and > characters in your placeholder names (not as variable markers), you can escape them with backslashes:
mock_placeholders:
# These placeholders contain literal < > characters in their names
cwduration_general_\<cwgame_countdown_next_match_state\>: "15:30"
cwduration_general_\<cwgame_countdown_next_mine_round\>: "01:20"
# Mixed: literal and dynamic variables
test_mixed_\<literal\>_<dynamic>: "Literal <literal> text and dynamic {dynamic}"In this example:
%cwduration_general_<cwgame_countdown_next_match_state>%will return "15:30"%cwduration_general_<cwgame_countdown_next_mine_round>%will return "01:20"%test_mixed_<literal>_something%will return "Literal text and dynamic something"
Key Points:
- Use
\<and\>to escape angle brackets - Escaped brackets are treated as literal characters, not variable markers
- You can mix escaped and unescaped brackets in the same placeholder
- The escaping only affects the placeholder name parsing, not the returned values
| Command | Permission | Description |
|---|---|---|
/papimock reload |
placeholdermock.admin |
Reload the plugin configuration |
Note: The permission placeholdermock.admin defaults to OP players.
mock_placeholders:
vault_eco_balance: "1000000"
vault_eco_balance_<player>: "{player} has $50,000"
vault_eco_top_1: "WealthyPlayer"
vault_eco_top_<rank>: "Player{rank}"Test with: %vault_eco_balance%, %vault_eco_balance_Steve%, %vault_eco_top_1%
mock_placeholders:
myplugin_player_level: "25"
myplugin_player_<player>_exp: "Player {player} has 1500 EXP"
myplugin_guild_<guild>_members: "Guild {guild} has 15 members"Test with: %myplugin_player_level%, %myplugin_player_Steve_exp%, %myplugin_guild_Warriors_members%
- Setup: Install PlaceholderAPI and PlaceholderAPI Mock on your test server
- Configure: Add mock placeholders for the plugins you're developing against
- Test: Use the mocked placeholders in your plugin development
- Iterate: Modify mock values and reload with
/papimock reloadas needed - Deploy: Remove this plugin before deploying to production
- Ensure PlaceholderAPI is installed and enabled first
- Check console for error messages
- Verify you're running Spigot/Paper 1.21+
- Use
/papimock reloadafter configuration changes - Enable
debug: trueto see loaded placeholders in console - Check placeholder syntax matches your configuration exactly
- Ensure placeholder identifiers match what you're testing
- Default permission is OP-only
- Grant
placeholdermock.adminto users who need to reload config
This plugin is designed for development only. Using it in production can:
- Provide fake data to players
- Interfere with real plugin functionality
- Cause confusion and unexpected behavior
- Lead to data inconsistencies
- Keep separate development and production server configurations
- Document which placeholders you're mocking for your team
- Test with real plugins before production deployment
- Remove all mock configurations before going live
This plugin is provided as-is for development purposes. For issues:
- Check your configuration syntax
- Verify PlaceholderAPI is working correctly
- Enable debug mode to diagnose problems
- Check server console for error messages
This project is licensed under the MIT License - see the LICENSE file for details.
Remember: This plugin is for development and testing only. Always use real plugins in production environments.
