G-EnchantBooks

插件

· 作者 Foxof7207

一个轻量级插件,添加了自定义附魔选项,易于配置。

0 本站下载 0 关注 更新于 9 个月前

最新 1.0.0 · 1.21.11 · Bukkit / Folia

一键开服(送7天)

G-EnchantBooks

轻量级自定义附魔,旨在还原原版手感。(无依赖项)

添加新的、可配置的附魔效果,并与原版机制(附魔台、铁砧、磨石等)无缝集成。

主要功能

  • 自定义附魔: 为工具、武器、盔甲、弓、三叉戟等提供全新的平衡性附魔。

  • 兼容原版: 与原版系统(附魔台、铁砧、书、村民、磨石、战利品表)完美配合。

  • 易于配置: 开箱即用的默认设置;通过单一且易读的配置文件进行调整。

  • 轻量高效: 低内存/CPU占用,且无需外部依赖库。

如何创建自定义附魔:

嗜血附魔
<?xml version="1.0" encoding="UTF-8"?>
<enchantment id="bloodlust" enabled="true">
    <display-name>Bloodlust</display-name>
    <description>Heals you and gives strength when you kill enemies</description>
    <book-lore>
        <line>§7Heals and empowers you when you slay enemies</line>
        <line>§7Restores §c{level} hearts §7and grants §4Strength {level}</line>
        <line>§7Apply to weapons via anvil</line>
    </book-lore>
    <category>combat</category>
    <max-level>3</max-level>

    <applicable-items>
        <item-group>weapons</item-group>
    </applicable-items>

    <recipe>
        <pattern>
            <row>NAN</row>
            <row>WBW</row>
            <row>NAN</row>
        </pattern>
        <ingredients>
            <ingredient key="N">NETHERITE_INGOT</ingredient>
            <ingredient key="A">ANCIENT_DEBRIS</ingredient>
            <ingredient key="W">WITHER_SKELETON_SKULL</ingredient>
            <ingredient key="B">BLAZE_ROD</ingredient>
        </ingredients>
    </recipe>

    <trigger event="ENTITY_DEATH">
        <conditions>
            <condition type="player-is-killer"/>
            <condition type="holding-enchanted-item" slot="MAIN_HAND"/>
        </conditions>

        <actions>
            <!-- Heal player based on level -->
            <action type="heal">
                <base-amount>2.0</base-amount>
                <per-level>1.0</per-level>
                <max-amount>10.0</max-amount>
            </action>

            <!-- Apply strength effect -->
            <action type="potion-effect">
                <effect>STRENGTH</effect>
                <duration-ticks>
                    <base>100</base>
                    <per-level>20</per-level>
                </duration-ticks>
                <amplifier>
                    <base>0</base>
                    <per-level>1</per-level>
                </amplifier>
            </action>
        </actions>
    </trigger>
</enchantment>

示例模板
<?xml version="1.0" encoding="UTF-8"?>
<enchantment id="lifesteal" enabled="true">
    <display-name>Your Enchant Name</display-name>
    <description>The description of your choice</description>
    <book-lore>
        <line>Choose a lore of your choice</line>
        <line>§7 You can use color code</line>
        <line>If you need help, join our Discord !</line>
    </book-lore>
    <category>Choose a category</category>
    <max-level>Choose a maximum level (ex. 3)</max-level>

    <applicable-items>
        <item-group>Choose an item group (weapons, tools, . . .)</item-group>
    </applicable-items>

    <recipe>
        <pattern>
            <row>GRG</row> #Here you can configure the recipe
            <row>RBR</row>
            <row>GRG</row>
        </pattern>
        <ingredients>
            <ingredient key="G">GHAST_TEAR</ingredient> #Choose any ingredients you wish
            <ingredient key="R">GOLDEN_APPLE</ingredient>
            <ingredient key="B">BOOK</ingredient>
        </ingredients>
    </recipe>

    <trigger event="ENTITY_DAMAGE_BY_ENTITY"> #You can choose how the enchant works
        <conditions>
            <condition type="player-is-attacker"/>
            <condition type="holding-enchanted-item" slot="MAIN_HAND"/>
            <condition type="damage-cause">
                <cause>ENTITY_ATTACK</cause>
                <cause>ENTITY_SWEEP_ATTACK</cause>
            </condition>
            <!-- 2 second cooldown to prevent spam healing -->
            <condition type="cooldown">
                <duration-ticks>
                    <base>40</base>
                    <per-level>-5</per-level>
                    <min>20</min>
                </duration-ticks>
            </condition>
        </conditions>

        <actions>
            <!-- Heal based on level (1-3 hearts) -->
            <action type="heal">
                <base-amount>1.0</base-amount>
                <per-level>1.0</per-level>
                <max-amount>6.0</max-amount>
            </action>

            <!-- Visual feedback -->
            <action type="spawn-particle">
                <particle>HEART</particle>
                <count>
                    <base>2</base>
                    <per-level>1</per-level>
                </count>
                <offset-x>0.3</offset-x>
                <offset-y>0.5</offset-y>
                <offset-z>0.3</offset-z>
            </action>

            <!-- Audio feedback -->
            <action type="play-sound">
                <sound>ENTITY_PLAYER_LEVELUP</sound>
                <volume>0.3</volume>
                <pitch>2.0</pitch>
            </action>
        </actions>
    </trigger>
</enchantment>

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源