COWMODSКаталог модов

Mana Attributes

A small API that adds a mana system controlled by entity attributes.

Автор: TheRedBrain10,1 тыс.10обновлён 16 апр. 2026 г.
Механики игрыБиблиотекиМагия

Описание

Mana Attributes

This API adds a mana system controlled by entity attributes.

Default implementation

LivingEntities can have up to manaattributes:max_mana amounts of mana. Mana is regenerated by manaattributes:mana_regeneration every manaattributes:mana_tick_threshold ticks.

When mana is reduced, regeneration is stopped for manaattributes:mana_regeneration_delay_threshold ticks.

When mana is <= 0, regeneration is stopped for manaattributes:depleted_mana_regeneration_delay_threshold ticks.

manaattributes:reserved_mana describes the percentage amount of maximum mana that is currently not available.

Default attribute values

  • manaattributes:max_mana: 0
  • manaattributes:mana_regeneration: 0
  • manaattributes:mana_tick_threshold: 20
  • manaattributes:mana_regeneration_delay_threshold: 20
  • manaattributes:depleted_mana_regeneration_delay_threshold: 60
  • manaattributes:reserved_mana: 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
}

Галерея

Default HUD

Последние версии

Все версии →
release

4.0.0

4.0.0
16 апр. 2026 г.1,5 тыс.Minecraft: 26.1, 26.1.1, 26.1.2fabric
Скачать
Что нового
# 4.0.0 - updated to 26.1.x
release

3.2.1

3.2.1
16 апр. 2026 г.96Minecraft: 1.21.11fabric
Скачать
Что нового
# 3.2.1 ## Fixes - fixed an issue where respawning would no longer reset mana after re-joining a world
release

3.2.0

3.2.0
17 февр. 2026 г.87Minecraft: 1.21.11fabric
Скачать
Что нового
# 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
release

3.1.0

3.1.0
1 февр. 2026 г.63Minecraft: 1.21.11fabric
Скачать
Что нового
# 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
release

3.0.0

3.0.0
25 окт. 2025 г.109Minecraft: 1.21.10fabric
Скачать
Что нового
# 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!
release

2.9.1

2.9.1
5 окт. 2025 г.725Minecraft: 1.21.1fabric
Скачать
Что нового
# 2.9.1 - fixed mana bar being empty when joining a world for the first time - bumped various dependency versions
release

2.9.0

2.9.0
15 сент. 2025 г.69Minecraft: 1.21.1fabric
Скачать
Что нового
# 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
release

2.8.1

2.8.1
25 авг. 2025 г.74Minecraft: 1.21.1fabric
Скачать
Что нового
# 2.8.1 - fixed game rules
release

2.8.0

2.8.0
25 авг. 2025 г.42Minecraft: 1.21.1fabric
Скачать
Что нового
# 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)
release

2.7.0

2.7.0
30 июл. 2025 г.192Minecraft: 1.21.1fabric
Скачать
Что нового
# 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)