PlaceholderAPI Integration
Integrate Showcase with other mods using essential PlaceholderAPI placeholders
PlaceholderAPI Integration
MC 1.21.1MC 1.21.2MC 1.21.4MC 1.21.5MC 1.21.6
Showcase provides essential PlaceholderAPI integration, allowing other mods and plugins to access core player share data through standardized placeholders.
Core Placeholders
Basic Sharing Placeholders
%showcase:item% # Share held item
%showcase:inventory% # Share inventory
%showcase:hotbar% # Share hotbar
%showcase:ender_chest% # Share ender chest
%showcase:stats% # Share statistics
Player Statistics
%showcase:shares_count% # Number of active shares
%showcase:total_views% # Total views received by player
Permission Checks
%showcase:can_share_item% # true/false - Can share items
%showcase:has_admin_perms% # true/false - Has admin permissions
Usage Examples
Basic Integration
public class ShowcasePlaceholderIntegration {
public void displayPlayerInfo(ServerPlayerEntity player) {
PlaceholderContext context = PlaceholderContext.of(player);
// Parse placeholders in text
Text shareCountText = Placeholders.parseText(
Text.literal("Active shares: %showcase:shares_count%"),
context
);
Text viewsText = Placeholders.parseText(
Text.literal("Total views: %showcase:total_views%"),
context
);
player.sendMessage(shareCountText);
player.sendMessage(viewsText);
}
public void checkPermissions(ServerPlayerEntity player) {
PlaceholderContext context = PlaceholderContext.of(player);
Text permissionText = Placeholders.parseText(
Text.literal("Can share items: %showcase:can_share_item%"),
context
);
player.sendMessage(permissionText);
}
}
Chat Integration
Use placeholders directly in chat for dynamic sharing:
Check out my %showcase:item%!
My inventory: %showcase:inventory%
Current stats: %showcase:stats%
Configuration
Enable PlaceholderAPI Support
integrations:
placeholderapi:
enabled: true
# Enable extended placeholder features
placeholder-extensions-enabled: true
Integration Examples
Economy Integration
public class EconomyIntegration {
public void rewardForSharing(ServerPlayerEntity player) {
PlaceholderContext context = PlaceholderContext.of(player);
String shareCount = Placeholders.parseText(
Text.literal("%showcase:shares_count%"),
context
).getString();
int shares = Integer.parseInt(shareCount);
int reward = shares * 10; // 10 coins per active share
// Give reward to player
giveCoins(player, reward);
}
}
Quest System
public class QuestIntegration {
public boolean checkSharingQuest(ServerPlayerEntity player) {
PlaceholderContext context = PlaceholderContext.of(player);
String viewsText = Placeholders.parseText(
Text.literal("%showcase:total_views%"),
context
).getString();
int views = Integer.parseInt(viewsText);
return views >= 100; // Quest: Get 100 total views
}
}
Migration from Extended Placeholders
If you were using advanced placeholders from previous versions, here's the migration guide:
Removed placeholders:
- Performance metrics (
%showcase:cache_hit_rate%
, etc.) - Server statistics (
%showcase:server_total_shares%
, etc.) - Detailed time tracking (
%showcase:shares_today%
, etc.) - Cooldown placeholders (
%showcase:item_cooldown%
, etc.)
Recommended alternatives:
- Use mod APIs directly for detailed statistics
- Implement custom tracking in your integration
- Use the remaining essential placeholders for core functionality
Troubleshooting
Reduced Complexity: The simplified placeholder system focuses on essential features only, improving performance and maintainability.
Common Issues
Placeholders not working:
- Verify PlaceholderAPI is installed
- Check that
placeholder-extensions-enabled: true
in config - Restart server after configuration changes
Migration from complex placeholders:
- Update your integrations to use core placeholders
- Implement custom statistics tracking if needed
- Use the Showcase mod API for advanced features