警告!默认情况下,Modrinth 不会下载所需的资源包。您必须前往版本页面并自行下载!
如果您有任何问题、反馈、建议,或希望将您的帽子收录进整合包(附带署名),请联系我的 Discord @parax342

信息
此数据包添加了 30 多种独特的装饰性帽子,您可以将其应用到世界中的任何头盔上。只要其他玩家拥有该资源包,他们就能看到您佩戴的帽子。仅需服务器运行此数据包即可。
输入 /trigger hat_menu 以在聊天栏中打开点击菜单。在主手持有任意头盔,然后选择您想要的帽子。转变为帽子后,头盔的防御属性、耐久度等都不会受到影响。
必需使用资源包,即使您不打算使用内置的帽子。如果您不想使用内置帽子,可以从数据包中移除它们。所有玩家都需要下载资源包(或者您可以将其设为服务器资源包),否则帽子将显示为缺失模型。
我制作此整合包的主要目标是让添加自定义帽子变得简单易懂,教程位于下方。任何基于此整合包构建的其他整合包都必须将其作为依赖项。
本整合包旨在与所有/大多数添加自定义物品的模组和数据包兼容。属于 #minecraft:head_armor 标签的任何物品都可以转变为帽子。在转变为帽子时,该物品会备份帽子所覆盖的任何组件,并在移除帽子时恢复这些组件。
被覆盖的组件包括 minecraft:equippable、minecraft:item_model 和 minecraft:enchantment_glint_override。所有这些组件纯粹仅用于外观效果。
制作您自己的帽子
任何包含自定义帽子的整合包都由两部分组成:资源包和数据包。
对于您的资源包,无需进行特殊操作,只需添加您的模型即可。
对于数据包,过程非常简单:
- 创建您的帽子注册表(数据包中的一个常规 mcfunction 文件)
- 将该函数添加到
#paraxs_hats:hat_registries
- 向您的函数中添加帽子(见下文)
要添加帽子,可以使用以下两个函数:
paraxs_hats:internal/register_hat 用于添加单个帽子
paraxs_hats:internal/register_hat_group 用于添加带有变体的帽子组
paraxs_hats:internal/register_hat 有两个参数——model 和 name。model 是资源包内模型的路径,name 是帽子在菜单中显示的名称。
paraxs_hats:internal/register_hat_group 也有两个参数——name 和 hats。name 仍然是帽子在菜单中显示的名称,而 hats 是一个字符串化的 JSON 数组,包含具有各自 model 和 name 的帽子。数组中每个帽子的 name 会在菜单中作为悬停文本显示,应用来标识变体。
将以下任一示例放入帽子注册表中,分别会注册一个单独的海盗帽或带有两种颜色变体的橄榄球头盔:
function paraxs_hats:internal/register_hat with {"name":"Pirate Hat","model":"my_hats:pirate_hat"}
function paraxs_hats:internal/register_hat_group with {"name":"Football Helmet","hats":'[{"name":"Red","model":"my_hats:red_football_helmet"},{"name":"Blue","model":"my_hats:blue_football_helmet"}]'}
任何使用此 API 的整合包 必须 将此数据包和资源包作为依赖项,否则它们将 无法 正常工作!
如果在添加帽子时遇到问题,请在 Discord 上联系我 @parax342
Warning! By default, Modrinth does not download the REQUIRED resource pack. You must go to the versions page and download it yourself!
If you have questions, issues, suggestions, or want your hats included in the pack (with credit), contact my discord @parax342

Information
This datapack adds 30+ unique cosmetic hats that you can apply to any helmet in your world. Any player will be able to see your hats so long as they have the resourcepack. Only the server needs to run the datapack.
Type /trigger hat_menu to pull up a click-menu in chat. Hold any helmet in your mainhand & select whatever hat you want. The helmet's defense stats, durability, etc. will all be unaffected by turning into a hat.
The resource pack is REQUIRED, even if you don't plan to use the built-in hats. If you don't want the built-in hats, you can remove them from the datapack . All players will need to download the resource pack (or you can make it a server resource pack), or else the hats will show up as missing models.
My main goal with this pack is to make it easy to add your own hats, a tutorial is further down. Any packs that are built off of this one must use it as a dependancy
This pack aims to be compatible with all/most mods & datapacks that add custom items. Any item in #minecraft:head_armor can be turned into a hat. When being turned into a hat, the item will back up any components the hat overrides, and then restore them when the hat is removed.
The components that get overridden are minecraft:equippable, minecraft:item_model, and minecraft:enchantment_glint_override. All of these components are purely cosmetic.
Making your own hats
Any pack of custom hats consists of two parts, the resourcepack and the datapack.
For your resourcepack, you don't need to do anything special, just add your models.
For the datapack, the process is very simple:
- Create your hat registry (a regular mcfunction file in your datapack)
- Add the function to
#paraxs_hats:hat_registries
- Add hats to your function (see below)
To add hats, there are two functions you can use:
paraxs_hats:internal/register_hat to add solo hats
paraxs_hats:internal/register_hat_group to add hats with variants
paraxs_hats:internal/register_hat has two parameters - model and name. model is the path of the model inside the resource pack, and name is what the hat displays as in the menu.
paraxs_hats:internal/register_hat_group also has two parameters - name and hats. name is still what the hat displays as in the menu, while hats is a stringified JSON array of hats with their own model and name. The name of each hat in the array appears as hovertext in the menu and should be used to denote the variant.
Placing either of the below examples into a hat registry would register a solo pirate hat or a football helmet with two colored variants respectively:
function paraxs_hats:internal/register_hat with {"name":"Pirate Hat","model":"my_hats:pirate_hat"}
function paraxs_hats:internal/register_hat_group with {"name":"Football Helmet","hats":'[{"name":"Red","model":"my_hats:red_football_helmet"},{"name":"Blue","model":"my_hats:blue_football_helmet"}]'}
Any packs that use this API must have this datapack & resourcepack as a dependency, or else they will not work!
If you are having issues adding hats, contact me on discord @parax342
评论 0
登录后参与评分
还没有评论,来抢沙发吧