TrinketInventory
A lightweight, stack-aware trinket GUI for Paper/Spigot 1.21+. Clean attribute handling with modern registry APIs, safe removal, and simple configuration.
What it does
- Adds a personal “trinket” inventory GUI that players can open (default command: /myinv).
- Items placed in unlocked slots grant attribute bonuses.
- Stack size in a single slot scales the bonus (up to the item’s max-stack-size), then global caps apply.
- Saves each player’s trinket inventory to disk and reapplies on join/respawn/world change (configurable).
Highlights
- Custom GUI: configurable title, rows, and locked slots with filler item.
- Whitelist and categories: allow only specific items, or enable category matching by ID prefix/name/lore.
- Modern attributes: uses the registry and keyed AttributeModifiers (no deprecated enum/UUID APIs).
- Safe and deterministic: per-player modifier keys and a re-entrancy guard to avoid duplicate application.
- Balance controls: per-attribute caps (e.g., armor, max_health, movement_speed, luck).
- Duplicate control: optionally disallow multiple slots with the same item ID (stack count in a single slot still counts).
How it works
- Player opens the trinket GUI and places allowed items into unlocked slots.
- Each allowed item contributes its configured modifiers. If the item is stacked, its effect is multiplied by the stack amount (capped by the item’s max-stack-size).
- Totals are capped by your global attribute caps.
- Modifiers are applied immediately on equip/move and on the events you enable in config.
Commands
- /myinv — Open your trinket inventory (name is configurable).
Permissions
- trinketinventory.open — Open the GUI
- trinketinventory.use — Interact with the GUI
- trinketinventory.bypass.duplicate — Allow duplicate item IDs in multiple slots
- trinketinventory.bypass.whitelist — Ignore whitelist restrictions
- trinketinventory.bypass.caps — Ignore attribute caps
Safety and enforcement
- Locked slots are enforced for clicks, drags, shift-moves, and hotbar swaps.
- Whitelist is enforced on all move types (cursor place, swap with cursor, shift-click into GUI, hotbar swap, drag into top inventory).
Modifiers are removed and re-applied atomically to prevent “Modifier already applied” errors.
FAQ
Q: Do stack sizes matter?
A: Yes. A single slot’s stack amount scales the bonus up to the item’s configured max-stack-size, then global caps may limit further gains.
Q: Why doesn’t speed/armor go past a value?
A: You likely hit the configured cap. Adjust stacking.attribute-caps or grant the bypass permission.
Q: Can I disable vanilla or ItemsAdder items?
A: Yes—see the “rules” section in the config.
Notes
- Attribute keys in the config should be plain (e.g., max_health, armor, movement_speed).
- The plugin normalizes and validates attributes against the server’s registry to avoid typos.
IF YOU LIKE MY PLUGIN PLEASE LEAVE A RATING AND AN HONEST REVIEW THANK YOU!