/custom-bossbar-textures

A fabric mod for making highly customizable bossbars using resource packs

Primary LanguageJava

Custom Bossbar Textures

This mod allows you to replace vanilla bossbars with highly customizable bossbars using resource packs.

Usage

  1. Create a folder named cbt in assets/minecraft/
  2. Inside cbt/ make a folder for your bossbar.
  3. Make a file named *.bossbar.
  4. Add the following text in the created file.

type=<hotbar type, see below>
name=<display name of the hotbar>
texture=<texture name without ".png">
overlay=<overlay name without ".png">

For example:

type=normal
name=Silver Construct
texture=silver_construct_texture
overlay=silver_construct_overlay

Bossbar types:

types

  1. Create a texture and an overlay for the hotbar.

    Texture and overlay should have the same size. Texture should contain everything and an empty bar. Overlay should only contain the depleting part itself.

silver_construct_texture silver_construct_overlay
Texture Overlay

Size of the bar in overlay will be calculated using leftmost and rightmost non-fully transparent pixels.

  1. Put the texture and the overlay in the same folder as the .bossbar file.

Phase texture changes

You can change the bossbar texture depending on how much health is left. For that add these lines to your .bossbar file.

texture.<%HP left>=<texture name without ".png">
overlay.<%HP left>=<overlay name without ".png">

If you don't include both texture and overlay paths for the same % HP, mod will try to find a fallback texture, but I don't recommend relying on that.

For example:

type=normal
name=Silver Construct
texture=silver_construct_texture_1
overlay=silver_construct_overlay_1
texture.66.6=silver_construct_texture_2
overlay.66.6=silver_construct_overlay_2
texture.33.3=silver_construct_texture_3
overlay.33.3=silver_construct_overlay_3

Animated textures

Bossbar texture could be animated in a way, similar to vanilla (stack all frames in one image). To show that a texture has multiple frames, add a line to your bossbar.

<texture path property>.frames=<frame duration in ticks for EACH frame>

For example:

type=double
name=Silver Construct
texture=silver_construct_texture
overlay=silver_construct_overlay
texture.frames=20,20

(silver_construct_texture has 2 frames)