PlaceholderAPI Mock Plugin
⚠️ DEVELOPMENT ONLY - DO NOT USE IN PRODUCTION
This plugin is designed exclusively for development and testing environments. It should NEVER be used on production servers.
Overview
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
Features
- 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
Requirements
- Spigot/Paper 1.21+
- PlaceholderAPI (required dependency)
- Java 17+
Installation
- 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
Configuration
The plugin configuration is located at
plugins/PlaceholderAPIMock/config.yml.
Basic Structure
Code (YAML):
# 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}"
Configuration Examples
Static Placeholders
Code (YAML):
mock_placeholders
:
# Economy plugin examples
vault_eco_balance
:
"9999999.99"
vault_eco_top_1
:
"RichPlayer123"
# Player data examples
playerdata_level
:
"50"
playerdata_exp
:
"1500"
Dynamic Placeholders
Code (YAML):
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"
Escaped Placeholders (Literal Angle Brackets)
Code (YAML):
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}"
Variable Types
You can use any variable name in angle brackets
<variable_name>
Use
{variable_name} in the value to reference the extracted variable.
Commands
Code (Text):
Command | Permission | Description
/papimock reload | placeholdermock.admin | Reload the plugin configuration
Note: The permission placeholdermock.admin defaults to OP players.
Usage Examples
For Economy Plugin Development
Code (YAML):
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%
For Custom Plugin Development
Code (YAML):
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%
Development Workflow
- 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 reload as needed
- Deploy: Remove this plugin before deploying to production
Troubleshooting
Plugin Not Loading
- Ensure PlaceholderAPI is installed and enabled first
- Check console for error messages
- Verify you're running Spigot/Paper 1.21+
Placeholders Not Working
- Use /papimock reload after configuration changes
- Enable debug: true to see loaded placeholders in console
- Check placeholder syntax matches your configuration exactly
- Ensure placeholder identifiers match what you're testing
Permission Issues
- Default permission is OP-only
- Grant placeholdermock.admin to users who need to reload config
Important Warnings
DO NOT USE IN PRODUCTION
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
Development Best Practices
- 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
Support
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
License
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.