Skip to content

API Reference

Placeholder API

Read sofyCore placeholders from code and register your own keys in the internal placeholder registry used by the scoreboard.

Reading a placeholder

Java
String rank = api.placeholders().resolve("rank_name", player.getUniqueId());

The identifier is the key without the sofycore_ prefix and without %. Unknown keys return an empty string. Resolvers read memory only.

Registering your own key

Java
api.placeholders().register("myplugin_kills", uuid -> String.valueOf(kills.getOrDefault(uuid, 0)));
  • Identifiers must match [a-z0-9_]+; registering an existing key throws IllegalArgumentException.
  • Registered keys are resolved by sofyCore texts that use its registry, such as the scoreboard and the staff mode hotbar, as %sofycore_myplugin_kills%.
  • They are not added to the PlaceholderAPI expansion, which only answers sofyCore's own keys.
  • Keep resolvers fast and free of I/O: they can run on the server thread for every refresh.