Skip to content

ItemModule

Kapitencraft edited this page Jun 28, 2026 · 1 revision

the item module adds a few functions related to items.

Armor

provides an extended ArmorItem and all features to add custom armor models, as shown in the tutorial.

Totem

provides the AbstractTotemItem class which contains the onUse method called to check if this totem is able to save the player from the lethal damage just taken

Sword

provides the LibSwordItem class which allows to override the damage type (kill message) used when attacking

Creative Tab Groups

adds the TabGroup and ArmorTabGroup classes used to group creative inventory content together

Fishing Hook

abstracts the vanilla fishing hook to be able to fish in different fluids and modify the used stats with the ModifyFishingHookStatsEvent

Compacting

the Compacting class exposes the tryCompact method which attempts to compact a given item into its compact form (gold -> gold block). the method returns a result containing the 2x2 (small) and 3x3 (large) compacting result if applicable

Item Modifier Display

item_modifier_display

provides a small tooltip next to attribute modifier lines that can show how much a certain trait of that item contributed to the overall value. you can register custom ones using the RegisterItemModifiersDisplayExtensionsEvent

Clone this wiki locally