AttributeItemUtils is a companion plugin for AttributeUtils. It builds fully attributed equipment from YAML kits, applies lore/affixes, and exposes hooks that let other plugins override drop, attribute-roll, and enchantment chances at runtime.
- Minecraft / Spigot 1.21+
- AttributeUtils installed and enabled (hard dependency)
- Drop the AttributeItemUtils JAR into your server's
plugins/folder alongside AttributeUtils. - Start the server to generate default configs:
config.yml(base attribute/enchant/drop chances)Gear.yml(kit definitions and weighting)AttributeUffixes.yml(name prefixes/suffixes)AttributeLore.yml(lore templates)EnchantmentPool.yml(allowed enchantments and weight tuning)
- Edit the generated YAML files to match your loot/gear goals, then
/reloador restart.
- Bell-curve weighted kits: Each kit in
Gear.ymldefines weighted material pools per slot plustarget-weight,steepness, andrangevalues that control how often high-weight entries are picked. Items are built throughGearServiceusing these curves, so common pieces drop more frequently while rare pieces remain possible. - Attribute-first item generation: Every built item rolls AttributeUtils definitions with per-slot trigger criteria, applies configurable modifier operations, and then reapplies persistent attributes so entities immediately benefit from their gear.
- Dynamic affixes and lore: Rolled attributes are normalized through
AttributeAffixConfigand formatted byAttributeLoreFormatter, giving items themed prefixes/suffixes and lore that explain the active stats. - Configurable enchantment pool: Optional enchantments are pulled from
EnchantmentPool.ymlusing a tunable base chance and bonus level logic. - Runtime chance overrides: Third-party plugins can register
EntityChanceHookimplementations to override drop, attribute, or enchant chances for specific mobs without touching YAML.
/aiukit <kit> [player] [targetWeight] [steepness] [range]- Applies a configured kit to the sender (or specified player) and optionally overrides bell-curve parameters for quick tuning.
/aiutestspawn <entityType> <kit> [targetWeight] [steepness] [range]- Spawns the requested entity with the given kit applied, honoring optional weighting overrides.
Both commands require the matching attributeitemutils.test.* permissions (OP by default) and tab-complete kit names and weight defaults for fast testing.
# Gear.yml
kits:
bandit:
target-weight: 5.0
steepness: 1.2
range: 4.0
helmet:
- LEATHER_HELMET:5
- CHAINMAIL_HELMET:2
hand:
- IRON_SWORD:4
- STONE_SWORD:8
attribute-operations:
example.multiplier_attribute: MULTIPLY- Drop chances default to
drops.chanceinconfig.yml, butEntityChanceHookcan override per-entity. - Attribute rolls use
attributes.base-chanceandattributes.bonus-percentuntil capped atattributes.max-chance. - Enchant rolls use
enchants.base-chance, respectingenchants.max-chanceandenchants.level-bonuswhen picking levels. - API consumers can call
AttributeChanceConfig#chance(nightsPassed)/EnchantChanceConfig#chance(nightsPassed)to scale chance by configurablenight-bonus-multipliervalues, or use the overloads that accept a manual multiplier.
Other plugins can change runtime behavior by registering hooks or invoking exposed services.
public final class MyChanceHook implements EntityChanceHook {
@Override
public Optional<Double> dropChanceFor(EntityType type) {
return type == EntityType.ZOMBIE ? Optional.of(0.25d) : Optional.empty();
}
}
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
AttributeItemUtilsPlugin aiu = getPlugin(AttributeItemUtilsPlugin.class);
aiu.registerChanceHook(new MyChanceHook());
}
}AttributeItemUtilsPluginapplyKit(LivingEntity entity, String kitName): Applies a named kit to an entity and returns whether it existed.reloadPluginConfigs(AttributeUtilitiesPlugin attributeUtils): Reloads all YAML configs and rebuilds services; call after editing files programmatically.getGearService(): Returns theGearServiceused by commands and integrations to build gear.getGearConfigLoader(): Exposes theGearConfigLoaderso you can inspect available kits or refresh them.registerChanceHook(EntityChanceHook hook)/getChanceHooks(): Registers or retrieves theEntityChanceHooksregistry for overriding chances.
GearServiceapplyKit(LivingEntity entity, KitConfig kit): Applies a preloaded kit directly (including attribute/enchant rolls and drop chances).Optional<KitConfig> getKit(String name): Fetches a kit definition by name for validation or reuse.
GearConfigLoadervoid reload(): Re-readsGear.ymlfrom disk, merging defaults before parsing entries.Optional<KitConfig> getKit(String name)/Map<String, KitConfig> getKits(): Access parsed kit definitions.
EntityChanceHookdropChanceFor(EntityType type),attributeChanceFor(EntityType type),enchantChanceFor(EntityType type): Override per-entity probabilities when registered with the plugin.
These APIs let hook plugins change loot odds dynamically (e.g., boosting boss drops), inspect kit contents, or apply gear on demand without reimplementing AttributeUtils glue.