Skip to content

BonusModule

Kapitencraft edited this page Jun 25, 2026 · 1 revision

the bonus module adds item- or set-bound enhancements.

Creating Bonuses

Bonuses are a data-driven registry. they are stored in the data folder under bonuses

the format for single item bonuses is the following:

{
  "bonus": {
    "type": "the type of bonus to be used",
    <more info for the bonus>
  },
  "hidden": "whether the codec should be visible on all attached items",
  "item": "the location of the item this bonus is applied to"
}

the format for set bonuses is:

{
  "bonus": {
    "type": "the type of bonus to be used",
    <more info for the bonus>
  },
  "equipment_slots": [
    <list of all slots to be used>
  ],
  "hidden": "whether the codec should be visible on all attached items",
  "wearable_slots": [
    <list of all wearable slots to be included>
  ]
}

note that wearable slots are only available if the Inventory Page module is also installed

to generate bonuses via datagen, use the BonusProvider and WearableBonusProvider classes respectively

Registering custom bonus types

if you wish to enhance with more than just AttributeModifiers or MobEffects, you have to create a custom Bonus Type. to do so, create a class implementing the Bonus interface and override any of the methods. reference their java docs for more info on what they do

Registering custom bonus providers

aside from static bonuses some developers might want to add dynamic bonuses that can change independently of the data provider. these bonuses can be registered using the RegisterBonusProvidersEvent and its subclasses ItemBound and EntityBound. as the name suggests the subclasses are differentiated ways of adding providers, one for items and another for the owning entity directly

Requirements

the bonus module is compatible with the requirement module.

Clone this wiki locally