All Mods Resource Packs Data Packs Shaders Modpacks Plugins
Mana Attributes

Mana Attributes

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

Mana Attributes

This API adds a mana system controlled by entity attributes.

Default implementation

LivingEntities can have up to _manaattributes:maxmana amounts of mana. Mana is regenerated by _manaattributes:manaregeneration every _manaattributes:mana_tickthreshold ticks.

When mana is reduced, regeneration is stopped for _manaattributes:mana_regeneration_delaythreshold ticks.

When mana is <= 0, regeneration is stopped for _manaattributes:depleted_mana_regeneration_delaythreshold ticks.

_manaattributes:reservedmana describes the percentage amount of maximum mana that is currently not available.

Default attribute values

  • _manaattributes:maxmana: 0
  • _manaattributes:manaregeneration: 0
  • _manaattributes:mana_tickthreshold: 20
  • _manaattributes:mana_regeneration_delaythreshold: 20
  • _manaattributes:depleted_mana_regeneration_delaythreshold: 60
  • _manaattributes:reservedmana: 0

All default values for players can be set in the server config.

Customization

The client config allows customizing the HUD element.

Using the mana system

Java

Casting a "LivingEntity" to the "ManaUsingEntity" interface gives access to all relevant methods.

Data packs

Mana Attributes implements several data driven methods to interact with the current mana value of an entity.

  • the "manaattributes:add_mana" enchantment effect allows adding a defined amount to the current mana
  • the "manaattributes:mana_using_entity" entity sub predicate passes when the current mana of an entity matches the defined range

Example

This enchantment reduces mana of the attacker by 2, as long as the attacker has at least 5 mana:

{
    "anvil_cost": 1,
    "description": {
        "translate": "enchantment.manaattributes.test"
    },
    "effects": {
        "minecraft:post_attack": [
            {
                "affected": "attacker",
                "effect": {
                    "type": "manaattributes:add_mana",
                    "amount": {
                        "type": "minecraft:linear",
                        "base": -2.0,
                        "per_level_above_first": -2.0
                    }
                },
                "enchanted": "attacker",
                "requirements": {
                    "condition": "minecraft:entity_properties",
                    "entity": "direct_attacker",
                    "predicate": {
                        "type_specific": {
                            "type": "manaattributes:mana_using_entity",
                            "mana_amount": {
                                "min": 5.0
                            }
                        }
                    }
                }
            }
        ]
    },
    "max_cost": {
        "base": 25,
        "per_level_above_first": 8
    },
    "max_level": 1,
    "min_cost": {
        "base": 5,
        "per_level_above_first": 8
    },
    "slots": [
        "hand"
    ],
    "supported_items": "#minecraft:swords",
    "weight": 5
}

How to Install Mana Attributes (Mod)

Mana Attributes by TheRedBrain is verified for Fabric across Minecraft versions 1.20.1, 1.21, 1.21.1, 1.21.10, 1.21.11, 26.1, 26.1.1, 26.1.2 (latest release: 4.0.0, file size: 107 KB). Follow the steps below to install it safely from ModCraft.tv:

  1. Click the Download button above and select your Minecraft version (1.20.1, 1.21, 1.21.1, 1.21.10, 1.21.11, 26.1, 26.1.1, 26.1.2) and platform (Fabric).
  2. Make sure you have the compatible loader or environment installed for Fabric.
  3. Move the downloaded Mana Attributes file into your Minecraft .minecraft/mods folder and launch the game.

All Versions

+ Add Version
Name Game version Platforms Published Downloads Actions
26.1.x
Fabric
7mo ago 1
1.21.11
Fabric
7mo ago 1
1.21.11
Fabric
9mo ago 1
1.21.11
Fabric
9mo ago 1
1.21.10
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.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.21.1
Fabric
last yr. 1
1.21.1
Fabric
last yr. 1
1.21
Fabric
last yr. 1
1.20.1
Fabric
last yr. 1
1.21
Fabric
last yr. 1
1.20.1
Fabric
last yr. 1
1.20.1
Fabric
last yr. 1
1.20.1
Fabric
last yr. 1
1.20.1
Fabric
last yr. 1
[4.0.0] 4.0.0 by TheRedBrain on Apr 16, 2026
Download
# 4.0.0

  • updated to 26.1.x

[3.2.1] 3.2.1 by TheRedBrain on Apr 16, 2026
Download
# 3.2.1

## Fixes

  • fixed an issue where respawning would no longer reset mana after re-joining a world

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

## Additions

  • readded API methods to set and get current mana
  • added "manaattributes:add_mana" enchantment effect
  • added "manaattributes:mana_using_entity" entity sub predicate
  • the mana icon bar now blinks when mana changes, similar to the vanilla health bar. This can be disabled in the client config.
  • the mana icon bar now displays reserved mana

## Fixes

  • fixed mana for players on respawn/joining a world
  • fixed regeneration delay

[3.1.0] 3.1.0 by TheRedBrain on Feb 01, 2026
Download
# 3.1.0

  • updated to 1.21.11

## Changes

  • regeneration delay timers no longer apply when joining a world

## Technical

  • migrated to Mojang Mappings
  • replace synced data with a data attachment, following the best practice for custom entity data

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

  • updated to 1.21.10

## Additions

## Changes

  • removed "generic." prefix from all entity attributes, following vanillas example

## Fixes

  • fixed wrong server config name. Sorry for the inconvenience this might have caused!

[2.9.1] 2.9.1 by TheRedBrain on Oct 05, 2025
Download
# 2.9.1

  • fixed mana bar being empty when joining a world for the first time
  • bumped various dependency versions

[2.9.0] 2.9.0 by TheRedBrain on Sep 15, 2025
Download
# 2.9.0

  • replaced game rules with server config options
  • tweaked default client config settings
  • fixed mana bar being empty when joining a world / respawning

[2.8.1] 2.8.1 by TheRedBrain on Aug 25, 2025
Download
# 2.8.1

  • fixed game rules

[2.8.0] 2.8.0 by TheRedBrain on Aug 25, 2025
Download
# 2.8.0

  • added "naturalMaximumMana" game rule
  • changed default value of "generic.max_mana" to 0
  • reworked the "naturalManaRegeneration" game rule (now is a double value, instead of a boolean)

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

  • added alternative mana bar consisting of icons, similar to vanillas resource bars (this first iteration does not yet support multiple icon types per bar, e.g. reserved mana)
  • reworked the "naturalManaRegeneration" game rule (now works with mods that display attribute values)
  • fixed an issue where the mana bar was empty when joining a world for the first time/respawning
  • fixed an issue where the mana bar was visible in creative mode
  • fixed an issue where the mana bar was visible even when the HUD was hidden (pressing F1)

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

  • removed debug log spam

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

HUD rendering overhaul
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.
  • removed 'is_centered' option, as it was redundant and unnecessarily complicated
  • '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.
  • changed default value of "generic.max_mana" to 10

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

HUD rendering overhaul
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.
  • removed 'is_centered' option, as it was redundant and unnecessarily complicated
  • '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.
  • changed default value of "generic.max_mana" to 10

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

  • fixed "offset_from_origin" config values not working correctly
  • mana number display is now independent of the mana bar

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

  • fixed "offset_from_origin" config values not working correctly
  • mana number display is now independent of the mana bar

Mana Attributes Icon
Download Mana Attributes
Select game version
Select platform