TabAPI
Developer library for adding tabs to inventory interfaces.
This API was initially developed for Minecraft version 1.20.1, but supports multiple game versions.
Functionality
The project was created as a foundation for the SkillZ modification and is based on the LibZ library code from Globox_Z. We preserved only the inventory interface functionality and added side panel creation capabilities.
Tab Configuration
For tabs with set identifiers, management is available through the configuration file config/tabapi_tabs.json. In this file, you can enable (true) or disable (false) individual tabs.
Developer Guide
To create custom tabs:
- Create a tab class by inheriting from the base
InventoryTabclass - Define the following parameters:
@Nullable Identifier id- unique tab identifier (specified only for permanent tabs with disable capability)MutableText tooltip- tooltip text when hovering@Nullable Identifier icon- tab icon (if null, you can specify an item using thegetItemStackmethod or configure custom rendering)int preferedPos- preferred tab position in the listboolean customRendering- custom rendering flag (when enabled, overriding thecustomRendermethod is required)Class... screenClasses- screen classes that the tab can work with (in most cases, one class is sufficient)
After creating the tab class, register it in the system using the TabAPI.registerInventoryTab or TabAPI.registerSideInventoryTab method in your mod's initialization method.