跳到正文

TabAPI

作者:Sygikal

API to add tabs to inventory screens

收藏

截图

介绍

中文介绍正在准备中,下面暂时显示原文。

An API to add inventory tabs.
Natively for 1.20.1 but should work on every version.

Made for SkillZ and based on Globox_Z’s LibZ I stripped out the other code and added sidebar functionality.

Disabling Tabs

If a tab has its ID set, you can find it under config/tabapi_tabs.json.

true for enabled, false for disabled.

Developer Tutorial
  • Create a tab class by extending InventoryTab
  • @Nullable Identifier id: The id of the tab. (Should only be set if its a permanent tab and allows it to be disabled)
  • MutableText tooltip: The tooltip when hovered
  • @Nullable Identifier icon: The icon for the tab (If null you can specify an item using getItemStack or custom rendering)
  • int preferedPos: Preferred index of the tab
  • boolean customRendering: If specified you have to override customRender in the tab class
  • Class... screenClasses: All the classes that this tab is able to handle (Most cases only need 1)
  • Register said tab with TabAPI.registerInventoryTab or TabAPI.registerSideInventoryTab in your mods init

常见问题

TabAPI 支持哪些 Minecraft 版本?

TabAPI 支持 Minecraft Java 版 1.20–1.20.6,共 7 个版本,可用的加载器:Fabric。下载时注意选择和你游戏版本一致的文件。

TabAPI 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:仅客户端。

评论

登录后评论和评分

Sygikal 的其他作品

查看全部 →