Mana Attributes 图标

Mana Attributes

作者:rebot | 分类:模组

价格:0 墨喵币 下载量:0 点赞:0 版本 4.0.0
本资源为搬运资源,原资源地址: https://modrinth.com/mod/mana-attributes
资源信息

Minecraft 版本: 26.1 26.1.1 26.1.2

平台: fabric

标签: game-mechanics library magic

资源介绍

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
}
下载太慢?试试 墨喵加速站,支持 Modrinth 和外网直链高速下载! 用的人越多,下载的越快!
下载与版本
评论(0)
登录 后发表评论。

暂无评论,抢个沙发吧~

举报此资源

请登录后举报

🔥 相关推荐
Optimized Modpacks Lite

价格:0 墨喵币
下载量:0

查看详情
Just Stone

价格:0 墨喵币
下载量:0

查看详情
Optim

价格:0 墨喵币
下载量:0

查看详情
MFSMP 2

价格:0 墨喵币
下载量:0

查看详情