Skip to content

EnchantmentModule

Kapitencraft edited this page Jun 28, 2026 · 2 revisions

the enchantment module implements besides a few custom effects also some other systems.

the custom Enchantment Effects

EnchantmentBlockBreakEffect

allows to implement effects when blocks are broken. override #onBreak

EnchantmentBowEffect

allows to implement effects when arrows are shot in order to store state / modify properties of the arrow. also allows to implement tick behavior and hit behavior

EnchantmentCountEffect

special type of post attack effect. allows to apply effect only every X hits or the first X hits.

Enchantment Tooltip Display

enchantment_info.png

Enchantment Info

applies different info of the enchantment. this includes whether the item is a treasure enchantment and can therefore not be obtained from the enchantment table and if the item is a villager tradable enchantment. furthermore a selected list of items the enchantment can be applied to is displayed. you can register your own item display info via RegisterEnchantmentApplicableCharsEvent and calling either the register method, giving it an item and resolving the texture to be used as <namespace>:textures/item/<item_id> or the overload which allows for the texture to be declared separately. (can be individually disabled in the config)

Enchantment Colors

changes the color of the enchantment display. accepts different configurations depending on

  1. level
  2. category (curse, ultimate)
  3. specific enchantment

of the enchantment to colourise. you get to the enchantment color configurator with /cec:

cec.png if you wish to distribute your configuration, you can find the stored JSON data of the enchantments within ./kap_lib/enchantment_colors_config.json where the root project is the game profile directory.

Enchantment Descriptions

enchantment descriptions can be added as translation keys using the title translation with .desc appended. for multi-line descriptions append an index starting with 1 to all appended tooltip lines.

wind charge example: enchantment_description.png

Clone this wiki locally