# 自定义物品分页

# 概述

用于扩展原版背包分页,让自定义物品配方能统一显示

# 注册

要使用自定义物品分页需要注册,在 behavior 文件夹下新建 netease_tab 文件夹,并添加任意名称的 json 文件,例如 bat.json

{
    "name": "英雄头盔",
    "icon": "textures/items/batman_helmet"
}

这样的话显示的分页名称为英雄头盔,图标为对应的 batman_helmet 图片

# 使用

在 behavior 文件夹下的自定义物品的 json 里,修改 category 为 Custom,

要在自定义分页默认显示,将 register_to_create_menu 设置为 true,参考示例如下

{
  "format_version": "1.10",
  "minecraft:item": {
    "description": {
      "identifier": "itemMod:testItem1",
      "register_to_create_menu":true,
      "category": "Custom"
    },
    "components": {
      "minecraft:max_stack_size": 64,
      "minecraft:max_damage": 10,
      "netease:show_in_hand": {
        "value": true
      }
    }
  }
}

在 resource 下的 netease_items_res 文件夹下对应的自定义物品 json 里,填入对应的资源,例如

注意这里不要填写 category

{
  "format_version": "1.10",
  "minecraft:item": {
    "description": {
      "identifier": "customitems:head1"
    },
    "components": {
      "minecraft:icon": "customitems:head1"
    }
  }
}

该 customitems:head1 即对应的 resource 下的 textures 文件夹下的 item_texture.json 里所包含的资源,例如

{
  "resource_pack_name": "vanilla",
  "texture_name": "atlas.items",
  "texture_data": {
    "customitems:test0": {
      "textures": "textures/items/customitems_head1"
    }
  }
}

这样显示的图标即为 customitems_head1