Skip to main content
SentryLore exposes several methods and managers to allow developers to interact with the lore engine, format custom items dynamically, or hook into the custom item registry.

Getting the Plugin Instance

To interact with SentryLore’s core managers, you can grab the main plugin instance using the static getPlugin() method.

Core API Reference

Database Item Registry

string
required
The unique alphanumeric ID of the saved custom item in the database (e.g. excalibur_v1).
String
The serialized Bukkit ItemStack encoded as a Base64 string, containing all NBT data, lore lines, and persistent dupe tokens. Returns null if the item is not registered.

Example 1: Creating Custom Loot Crates

If you are developing a custom Crates plugin or a webstore package distributor, you can hook into the SentryLore database to spawn in legendary items that an administrator saved via /lore save. This ensures that the items spawned are exactly how the admin configured them in-game, complete with unique Dupe Protection NBT tags.

Example 2: Forcing Lore on Custom Mobs

SentryLore automatically formats vanilla items when they are picked up or moved. However, if you have a custom plugin that spawns a boss mob with custom drops, you can force the SentryLore engine to apply its RPG formatting (rarity, stats, classes) before the item even hits the ground! You achieve this using the LoreFormatter utility class.
formatVanillaItem(item) modifies the ItemStack directly (passed by reference). Ensure you apply it before displaying the item to the player! If you want to STRIP existing SentryLore formatting and re-apply it (e.g., if you changed the item’s attributes), use LoreFormatter.forceReformat(customLoot); instead.
Last modified on October 24, 2026