Hat Loader

v1.3.0·Updated 2025-07-13

Allows you to easily make new hats using special hat files.

About this mod Author’s original text

Hat Loader

Allows you to easily make new hats using special -hat.spapi files. No code required!

How it's done

Inside of the plugins folder (doesn't have to be directly inside, the files can be in subfolders inside plugins), make files ending in -hat.spapi for each hat you want to make. The files should look like this:

Name

{name of your hat}

NorthSprites

{paths to your hat sprites, relative to the -hat.spapi file}

SouthSprites

{paths to your hat sprites, relative to the -hat.spapi file}

WestSprites

{paths to your hat sprites, relative to the -hat.spapi file}

EastSprites

{paths to your hat sprites, relative to the -hat.spapi file}

NorthwestSprites

{paths to your hat sprites, relative to the -hat.spapi file}

NortheastSprites

{paths to your hat sprites, relative to the -hat.spapi file}

HatRoomSprite

{sprite that will be displayed in the hat room} (optional, hat room sprite defaults to the first normal given hat sprite)

XOffset

{your hat's horizontal offset, in pixels} (optional, defaults to 0)

YOffset

{your hat's vertical offset, in pixels} (optional, defaults to 0)

FPS

{fps for your hat's animations, if it's animated} (optional, defaults to 4. does nothing if the hat is not animated)

AttachedToHead

{True if you want the hat to be achored on the character's head, False if you want it to be anchored on the character's eyes} (optional, defaults to True)

InFrontWhenFacingBack

{True if you want the hat to be in front of the character while facing back, False otherwise} (optional, defaults to True)

InFrontWhenFacingFront

{True if you want the hat to be in front of the character whlie facing front, False otherwise} (optional, defaults to True)

FlipOnRoll

{True if you want the hat to flip when the player rolls, similarly to hats in Exit the Gungeon, False otherwise} (optional, defaults to True)

VanishOnRoll

{True if you want the hat to disappear when the player rolls, False otherwise} (optional, defaults to False. takes priority over FlipOnRoll)

FlipStartSound

{the sound you want to play when this hat's roll flip starts} (optional, defaults to no sound)

FlipEndSound

{the sound you want to play when this hat's roll flip ends} (optional, defaults to no sound)

FlipSpeed

{a speed multiplier for how fast this hat spins during its flip animation} (optional, defaults to 1. setting this to 0 will result in the hat simply bouncing above the player instead of spinning)

FlipHeight

{a multiplier for how high this hat bounces during its flip animation} (optional, defaults to 1)

FlipHorizontalWithPlayer

{True if this sprite should be automatically flipped with the player's sprite, False otherwise} (optional, if a value is not given it will be automatically decided based on the hat's directionality)

Properties can go in any order. Optional hat properties do not have to be included in the hat files, in which case they will instead get set to their default values. Not all Sprites properties have to be given in the file, the hat's directionality will be decided based on which sprite directions are given using this table:

| Given sprite directions | Directionality | FlipHorizontalWithPlayer default |

|-|-|-|

| SouthSprites | None (single direction) | True |

| WestSprites, EastSprites | Two way (horizontal) | False |

| NorthSprites, SouthSprites | Two way (vertical) | True |

| NorthSprites, WestSprites, SouthSprites, EastSprites | Four way | False |

| All sprite directions given | Six way | False |

Multiple sprite paths can be given for a sprite direction, in which case that direction will be animated. Sprite paths are relative to the hat file's folder, so a sprite path of hat_idle_001 for a hat file with the path plugins/YourHat/yourhat-hat.spapi will lead to plugins/YourHat/hat_idle_001.png, a sprite path of SomeSubfolder/hat_idle_001 will lead to plugins/YourHat/SomeSubfolder/hat_idle_001.png, etc. Sprite paths don't need to have extensions.

Shaders

Hat Loader allows you to apply shaders to your hats. To do that, you need to add the ShaderName proper

Install & use Install: BepInEx plugin

  1. The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
  2. Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
  3. Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
  4. Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.

Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.

Dependencies

Install these first, or the mod will not work:

MtG_API-Mod_the_Gungeon_APIAlexandria-Alexandria

File & checksum

Filename
Hat_Loader-1.3.0.zip
File size
19.2 KiB