Mad Hatter
Over 30 cosmetic hats & an easy-to-use API
Mad Hatter
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: 1. Create your hat registry (a regular mcfunction file in your datapack) 2. Add the function to `#paraxs_hats:hat_registries` 3. 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 %%MD0%% have this datapack & resourcepack as a dependency, or else they will %%MD0%% work! If you are having issues adding hats, contact me on discord @parax342