ItemSets

public final class ItemSets

Item sets are enchantments whose definition lists piece slots (ItemSetDefinition). A set is complete while every piece slot holds an item carrying its enchantment. Its hooks then run once per input; an incomplete set runs nothing.

Set lore templates take these placeholders: $setName, $equippedPieces, $totalPieces, $setPieces (one line per piece from equippedPiece or missingPiece, which take $pieceName and $pieceSlot), and the line prefixes $ifSetComplete and $ifSetIncomplete. Hosts place the section with presentation; equipment changes redraw it with refresh.

Types

Link copied to clipboard
public final class Active extends Record
A complete worn set and the level it runs at, the lowest level among its pieces.

Functions

Link copied to clipboard
public static List<ItemSets.Active> active(Map<String, ItemStack> equipment, Function<String, EnchantmentItems.Resolved> resolver)
Complete sets in captured equipment, in identity order.
Link copied to clipboard
public static boolean appliesAt(EnchantmentDefinition definition, EnchantmentDefinition.Slot slot, Map<String, ItemStack> equipment)
For hosts that read equipment slot by slot: ordinary enchantments count at every slot, while a set counts once, at the first of its piece slots, and only while it is complete.
Link copied to clipboard
public static Map<String, Set<EnchantmentDefinition.Slot>> equippedPieces(Map<String, ItemStack> equipment, Function<String, EnchantmentItems.Resolved> resolver)
Filled piece slots of each set present in captured equipment, keyed by set enchantment id.
Link copied to clipboard
public static boolean hasEnchantmentLines(ItemMeta meta, Function<String, EnchantmentItems.Resolved> resolver)
Whether the shared enchantment section shows a line for this item.
Link copied to clipboard
public static ItemStack placePresentation(ItemStack source, String placeholder, Function<String, EnchantmentItems.Resolved> resolver)
For hosts whose lore is authored text: replaces the first line holding placeholder with the set section, or appends the section when no line holds it, and records it like presentation.
Link copied to clipboard
public static List<String> presentation(ItemMeta meta, Player holder, Function<String, EnchantmentItems.Resolved> resolver)
Renders this item's set section for host lore and records it on meta, so equipment changes can redraw it in place.
Link copied to clipboard
public static void refresh(Player player)
Redraws worn-state set lore on every item in this player's inventory.