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.

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 July 28, 2026