All Mods Resource Packs Data Packs Shaders Modpacks Plugins
Resource Bar API

Resource Bar API

by TheRedBrain • Downloads: 0 • Followers: 0
Description
Gallery
Changelog
Versions

Resource Bar API

A small java API mod that allows mods to easily set up a complete resource bar HUD element.

This can be for example a mana bar.

This API does not do all the work. All this API does is provide a method that draws the HUD element according to the given parameters.

It does not decide under which conditions the element should be rendered. That is the job of the mod using this API. This decision was made to ensure maximum flexibility when using this API.

All Versions

+ Add Version
Name Game version Platforms Published Downloads Actions
26.1.x
Fabric
6mo ago 1
1.21.11
Fabric
8mo ago 1
1.21.11
Fabric
9mo ago 1
1.21.10
Fabric
last yr. 1
1.21.1
Fabric
last yr. 1
1.20.1
Fabric
last yr. 1
1.21.1
Fabric
last yr. 1
1.20.1
Fabric
last yr. 1
1.21.1
Fabric
last yr. 1
1.21.1
Fabric
last yr. 1
1.20.1
Fabric
last yr. 1
1.20.1
Fabric
last yr. 1
1.21.1
Fabric
last yr. 1
1.20.1
Fabric
last yr. 1
1.21.1
Fabric
last yr. 1
1.21.1
Fabric
last yr. 1
1.20.1
Fabric
last yr. 1
1.20.1
Fabric
last yr. 1
1.21.1
Fabric
last yr. 1
1.20.1
Fabric
last yr. 1
1.21.1
Fabric
last yr. 1
1.21.1
Fabric
last yr. 1
1.21.1
Fabric
last yr. 1
1.20.1
Fabric
last yr. 1
1.21.1
Fabric
last yr. 1
1.20.1
Fabric
last yr. 1
[4.0.0] 4.0.0 by TheRedBrain on Apr 15, 2026
Download
# 4.0.0

  • updated to Minecraft 26.1.x
  • removed deprecated "icon resource bar" API method

[3.2.0] 3.2.0 by TheRedBrain on Feb 17, 2026
Download
# 3.2.0

## Changes

  • reworked icon resource bars to support multiple icon types per resource bar
  • the old API method was deprecated

[3.1.0] 3.1.0 by TheRedBrain on Jan 25, 2026
Download
# 3.1.0

  • updated to 1.21.11
  • migrated to Mojang Mappings

[3.0.0] 3.0.0 by TheRedBrain on Oct 25, 2025
Download
# 3.0.0

  • updated to 1.21.10

[2.7.0] 2.7.0 by TheRedBrain on Jul 30, 2025
Download
# 2.7.0

  • added icon resource bars, similar to the vanilla resource bars. This first iteration does not support multiple icon types per bar yet (eg absorption hearts). This will (hopefully) be implemented at a later stage.
  • several API methods were renamed and split up

[1.6.2] 1.6.2 by TheRedBrain on Dec 08, 2024
Download
# 1.6.2

  • fixed some other wrong calculations

[2.6.2] 2.6.2 by TheRedBrain on Dec 08, 2024
Download
# 2.6.2

  • fixed some other wrong calculations

[1.6.1] 1.6.1 by TheRedBrain on Dec 08, 2024
Download
# 1.6.1

  • fixed some wrong calculations

[2.6.1] 2.6.1 by TheRedBrain on Dec 08, 2024
Download
# 2.6.1

  • fixed some wrong calculations

[2.6.0] 2.6.0 by TheRedBrain on Dec 08, 2024
Download
# 2.6.0

This is a pretty fundamental rewrite. The initial idea of splitting a bar into three textures per "layer" to allow for easy change of the bar length, came with the cost of massive FPS drops.
With this rewrite the bar size is no longer changeable with a simple config option. Each 'layer' consists of only 1 texture (which can have configurable dimensions).
In addition, the texture can be dynamically replaced by another texture (with configurable dimensions) depending on the max value.
The result of the rewrite is a much, MUCH more optimised API.
  • removed 'is_centered' option, as it was redundant and unnecessarily complicated the calculations.
  • 'fill_direction' no longer chooses between a horizontal and a vertical 'texture set', it only determines the direction from which the bar is filled. This means that changing between horizontal and vertical resource bars also requires a texture change.
  • added the option to display an icon (with configurable texture id and dimensions). This can be toggled independently of the bar and the number.
  • added a server config option to enable debug logs

[1.6.0] 1.6.0 by TheRedBrain on Dec 08, 2024
Download
# 1.6.0

This is a pretty fundamental rewrite. The initial idea of splitting a bar into three textures per "layer" to allow for easy change of the bar length, came with the cost of massive FPS drops.
With this rewrite the bar size is no longer changeable with a simple config option. Each 'layer' consists of only 1 texture (which can have configurable dimensions).
In addition, the texture can be dynamically replaced by another texture (with configurable dimensions) depending on the max value.
The result of the rewrite is a much, MUCH more optimised API.
  • removed 'is_centered' option, as it was redundant and unnecessarily complicated the calculations.
  • 'fill_direction' no longer chooses between a horizontal and a vertical 'texture set', it only determines the direction from which the bar is filled. This means that changing between horizontal and vertical resource bars also requires a texture change.
  • added the option to display an icon (with configurable texture id and dimensions). This can be toggled independently of the bar and the number.
  • added a server config option to enable debug logs

[1.5.0] 1.5.0 by TheRedBrain on Dec 06, 2024
Download
# 1.5.0

  • added API method for clearing the resource bar value cache of a given resource bar
  • resource number rendering is now independent of the resource bar

[2.5.0] 2.5.0 by TheRedBrain on Dec 06, 2024
Download
# 2.5.0

  • added API method for clearing the resource bar value cache of a given resource bar
  • resource number rendering is now independent of the resource bar

[1.4.1] 1.4.1 by TheRedBrain on Dec 03, 2024
Download
# 1.4.1

  • fixed reserved value display

[2.4.1] 2.4.1 by TheRedBrain on Dec 03, 2024
Download
# 2.4.1

  • fixed reserved value display

[2.4.0] 2.4.0 by TheRedBrain on Dec 03, 2024
Download
# 2.4.0

  • added dependency on Fzzy Config

[1.4.0] 1.4.0 by TheRedBrain on Dec 03, 2024
Download
# 1.4.0

  • added dependency on Fzzy Config

[1.3.0] 1.3.0 by TheRedBrain on Dec 01, 2024
Download
# 1.3.0

  • added dynamic element length based on max value (with individual values for background, progress and reserved layer)
  • added dynamic element offsets based on max value
  • added additional static offsets
  • fixed overlay not respecting "is_centered" config option

[2.3.0] 2.3.0 by TheRedBrain on Dec 01, 2024
Download
# 2.3.0

  • added dynamic element length based on max value (with individual values for background, progress and reserved layer)
  • added dynamic element offsets based on max value
  • added additional static offsets
  • fixed overlay not respecting "is_centered" config option

[1.2.0] 1.2.0 by TheRedBrain on Nov 30, 2024
Download
# 1.2.0

  • fixed a bunch of issues

[2.2.0] 2.2.0 by TheRedBrain on Nov 30, 2024
Download
# 2.2.0

  • changed "drawGuiTexture" back to "drawTexture" method calls, texture identifiers need to reflect this

[2.1.1] 2.1.1 by TheRedBrain on Nov 24, 2024
Download
# 2.1.1

Reading can help!

[2.1.0] 2.1.0 by TheRedBrain on Nov 24, 2024
Download
# 2.1.0

  • moved "ResourceBarFillDirection" and "ResourceBarOrigin" enums to main source set
  • changed "drawTexture" to "drawGuiTexture" method calls, texture identifiers need to reflect this

[1.1.0] 1.1.0 by TheRedBrain on Nov 24, 2024
Download
# 1.1.0

  • moved "ResourceBarFillDirection" and "ResourceBarOrigin" enums to main source set

[2.0.0] 2.0.0 by TheRedBrain on Nov 24, 2024
Download
# 2.0.0

  • updated to 1.21.1

[1.0.0] 1.0.0 by TheRedBrain on Nov 21, 2024
Download
# 1.0.0

First release!

#
Resource Bar API Icon
Download Resource Bar API
Select game version
Select platform