Troubleshooting
Placeholder Not Resolving
Problem: ${custom.placeholder} returns unchanged
Solutions:
- Verify the neuron is registered:
new MyNeuron(this).register(); - Check namespace spelling matches exactly
- Ensure placeholder is registered in the neuron
- Check server logs for registration errors
Player-Only Placeholder Fails with Console
Problem: Exception when console uses player-specific placeholder
Solution: Use requirePlayer() - it handles the error automatically:
register("health", context -> {
Player player = context.user().requirePlayer(); // Throws exception if not player
return String.format("%.1f", player.getHealth());
});
Placeholder Returns Stale Data
Problem: Cached placeholder shows old value
Solutions:
- Reduce cache TTL:
options.cacheTTL(30, TimeUnit.SECONDS); - Disable caching:
options.cache(false); - Use refresh for static placeholders:
options.refresh(true);
Async Placeholder Blocking Server
Problem: Server freezes when translating
Solution: Use translateAsync() for expensive operations:
synapse.translateAsync("${database.query}", player)
.thenAccept(player::sendMessage);