LovelyEnchant
LovelyEnchant 是一款基于 Purpur 1.21.11、专为 Java 25 构建的附魔台插件。它将原版附魔台的流程替换为可配置的 GUI 商店,支持附魔书购买,包含反附魔退款功能,并添加了高风险的附魔赌徒机制。
要求
- Purpur
1.21.11
- Java
25
- Vault
- 一个与 Vault 兼容的经济插件,例如 EssentialsX
此版本专门针对 Purpur 1.21.11 和 Java 25 构建。
功能
-
附魔商店 GUI:/eshop 打开一个菜单,玩家可以在其中安全地为手中的物品购买附魔。
-
原版工作台重定向:右键点击附魔台会打开 /eshop 菜单,而不是原版的附魔台界面。
-
附魔书:手持普通书本时,玩家可以购买附魔书,并拥有独立可配置的书籍价格倍率。
-
书本开关:附魔书的购买功能可在配置文件中或通过管理员对话框编辑器启用或禁用。
-
Enchantment Gambler:玩家可以押注物品上的所有当前附魔,以尝试获得一个随机的新附魔。
-
Extra Enchant Jackpot:成功的赌注可以额外随机抽取一次新的附魔。
-
Disenchant GUI:使用 /disenchant 命令移除选定的附魔,并退还部分配置好的价格。
-
Admin Enchanter:/enchanter <玩家> <附魔> <等级> 可为玩家当前手持的物品施加任意附魔。
-
Dialog API 管理员编辑器:/eshopadmin edit 或 /esa 会打开一个适用于 Paper/Purpur 的服务端内对话编辑器,用于实时配置设置。
-
JSON 配置文件:费用、消息、音效、权限模式、黑名单、最高等级、赌徒概率以及退款设置均可自定义配置。
安装方法
- 停止服务器。
- 安装 Vault 以及一个兼容 Vault 的经济插件。
- 将
LovelyEnchant-1.0.0.jar 放入服务器的 plugins 文件夹中。
- 启动一次服务器以生成:
plugins/LovelyEnchant/config.json
- 手动编辑配置文件,或使用
/esa 命令。
- 在手动修改配置后,运行
/eshop reload。
如果您是从旧版 EnchantShop 配置迁移,请先删除旧的生成配置文件,以便生成新的 LovelyEnchant 选项。
指令
| 命令 |
描述 |
权限 |
/eshop |
打开主商店菜单。 |
lovelyenchant.open |
/eshop reload |
重新加载 config.json。 |
lovelyenchant.reload |
/eshopadmin edit |
打开 Dialog API 管理员编辑器。 |
lovelyenchant.edit |
/esa |
管理员编辑器的别名。 |
lovelyenchant.edit |
| /disenchant | 打开附魔解除界面。 | lovelyenchant.disenchant |
| /enchanter <玩家> <附魔> <等级> | 为玩家手中的物品添加附魔。 | lovelyenchant.enchanter |
为保持兼容性,仍接受旧的 enchantshop.* 权限节点。
权限
| 权限 |
默认值 |
描述 |
lovelyenchant.open |
true |
允许使用 /eshop 以及附魔台重定向访问。 |
lovelyenchant.disenchant |
true |
允许使用 /disenchant。 |
lovelyenchant.reload |
op |
允许使用 /eshop reload。 |
lovelyenchant.enchanter |
op |
允许使用 /enchanter。 |
lovelyenchant.edit |
op |
允许使用 /eshopadmin edit 和 /esa。 |
lovelyenchant.buy.* |
op |
当启用单项附魔权限时,允许购买任意附魔。 |
lovelyenchant.buy.<enchant_name> |
false |
当启用单项附魔权限时,允许购买指定的一种附魔。 |
lovelyenchant.admin |
op |
授予重载、附魔师、编辑、打开及通配符购买权限。 |
单项附魔节点示例:
lovelyenchant.buy.sharpness
玩家指南
购买附魔
- 手持可附魔的物品。
- 运行
/eshop,或右键点击附魔台。
- 点击 Cường hóa。
- 选择一种附魔。
- 选择等级。
- 支付配置好的价格。
购买附魔书
- 手持普通书本。
- 运行
/eshop。
- 点击 Cường hóa。
- 选择附魔和等级。
- 消耗一本普通书,并将生成的附魔书加入背包。
如果 enchantedBooksEnabled 为 false,则玩家无法制作附魔书。
赌博附魔
- 手持至少已有一个附魔的物品。
- 运行
/eshop。
- 点击 物品下注。
- 成功时,物品获得一个随机的新附魔。
- 中大奖(jackpot)时,物品额外获得一个随机的附魔。
- 失败时,物品上的所有附魔都会被移除。
反附魔
- 手持一个已附魔的物品。
- 运行
/disenchant。
- 点击要移除的附魔。
- 该附魔被移除,玩家获得配置好的退款。
管理员编辑器
运行:
/esa
或:
/eshopadmin edit
管理员编辑器使用 Paper/Purpur 对话框 API,并将更改直接保存到 config.json。
当前编辑器面板:
- 经济与书籍:价格公式、书籍购买、书籍倍率、附魔台重定向、按附魔权限。
- 赌徒:胜率与额外附魔几率。
- 分解附魔:退款百分比。
- 菜单标题:GUI 标题。
- 音效:成功、失败及赌博音效。
- 附魔费用:设置单个附魔的基础费用。
- 附魔规则:设置单个附魔的最大等级覆盖和黑名单状态。
- 消息文本:编辑任意消息键值。
- 重载配置:从磁盘重新加载配置文件。
配置
配置文件路径:
plugins/LovelyEnchant/config.json
生成的默认值:
{
"costFormula": "base_cost * (level * level)",
"enchantmentBaseCosts": {
"minecraft:sharpness": 1000.0,
"minecraft:protection": 1200.0,
"minecraft:efficiency": 800.0,
"minecraft:unbreaking": 1500.0,
"minecraft:mending": 10000.0
},
"mainMenuTitle": "&8主菜单",
"enchantSelectTitle": "&1选择附魔",
"levelSelectTitle": "&1选择附魔等级",
"disenchantGUITitle": "&8移除附魔",
"autoOpenEnchantingTable": true,
"enchantedBooksEnabled": true,
"enchantedBookCostMultiplier": 1.0,
"successSound": "ENTITY_PLAYER_LEVELUP",
"failSound": "ENTITY_VILLAGER_NO",
"gambleTickSound": "BLOCK_NOTE_BLOCK_HAT",
"gambleWinSound": "ENTITY_FIREWORK_ROCKET_TWINKLE",
"gambleLoseSound": "ENTITY_VILLAGER_DEATH",
"gambleDoubleSound": "UI_TOAST_CHALLENGE_COMPLETE",
"gambleChanceToWinPercent": 50,
"gambleChanceForSecondEnchantPercent": 20,
"messages": {
"prefix": "&8[&d附魔&8] &r",
"no_permission": "&c你没有权限使用此命令。",
"no_enchant_permission": "&c你没有权限购买此附魔。",
"no_item_in_hand": "&c你必须手持一个物品!",
"item_not_enchantable": "&c你手中的物品无法进行附魔。",
"books_disabled": "&c附魔书生成当前已禁用。",
"not_enough_money": "&c你的金钱不足!需要 &e{cost}&c。",
"enchant_success": "&a已成功为物品附上 &e{enchant} {level} &a,花费 &e{cost}&a!",
"config_reloaded": "&a配置已成功重载!",
"disenchant_success": "&a已移除 &e{enchant} {level} &a并返还 &e{refund}&a!",
"item_not_disenchantable": "&c你手中的物品没有可移除的附魔。",
"gamble_no_enchants": "&c你手持的物品至少需要一个附魔才能参与抽奖!",
"gamble_no_available_enchants": "&c此物品无法获得额外的随机附魔。",
"gamble_win": "&a获胜!&f你的物品获得了 &e{enchant} {level}&f!",
"gamble_win_extra": "&6大奖!&f你额外获得了随机附魔:&e{enchant} {level}&f!",
"gamble_lose": "&c失败!&f物品上的所有附魔已被 &c清除&f!"
},
"perEnchantPermissions": false,
"enchantmentBlacklist": [
"minecraft:binding_curse"
],
"maxLevelOverrides": {},
"disenchantRefundPercentage": 50.0
}
价格公式
costFormula 支持以下变量:
base_cost: 所选附魔的配置基础价格
level: 所选的附魔等级
示例:
"costFormula": "base_cost * (level * level)"
如果 minecraft:sharpness 的基础价格为 1000,则等级 3 的价格为 9000。
附魔书的价格计算公式为:
normal_cost * enchantedBookCostMultiplier
LovelyEnchant
LovelyEnchant is a Purpur 1.21.11 enchantment shop plugin built for Java 25. It replaces the vanilla enchanting table flow with a configurable GUI shop, supports enchanted book purchases, includes disenchant refunds, and adds a risky enchantment gambler.
Requirements
- Purpur
1.21.11
- Java
25
- Vault
- A Vault-compatible economy plugin, such as EssentialsX
This build is intentionally targeted at Purpur 1.21.11 and Java 25 only.
Features
- Enchant Shop GUI:
/eshop opens a menu where players can safely buy enchantments for the item in their hand.
- Vanilla Table Redirect: right-clicking an enchanting table opens the
/eshop menu instead of the vanilla enchanting table.
- Enchanted Books: holding a normal book lets players buy enchanted books, with a separate configurable book price multiplier.
- Book Toggle: Enchanted book purchases can be enabled or disabled in config or through the admin dialog editor.
- Enchantment Gambler: players can risk all current enchantments on an item for a chance to win a random new enchantment.
- Extra Enchant Jackpot: successful gambles can roll a second random enchantment.
- Disenchant GUI:
/disenchant removes selected enchantments and refunds part of the configured price.
- Admin Enchanter:
/enchanter <player> <enchant> <level> applies any enchantment to a player's held item.
- Dialog API Admin Editor:
/eshopadmin edit or /esa opens an in-game Paper/Purpur dialog editor for live settings.
- JSON Configuration: costs, messages, sounds, permissions mode, blacklist, max levels, gambler chances, and refunds are configurable.
Installation
- Stop the server.
- Install Vault and a Vault-compatible economy plugin.
- Place
LovelyEnchant-1.0.0.jar in the server plugins folder.
- Start the server once to generate:
plugins/LovelyEnchant/config.json
- Edit the config manually or use
/esa.
- Run
/eshop reload after manual config edits.
If you are migrating from an old EnchantShop config, delete the old generated config first so the new LovelyEnchant options can generate.
Commands
| Command |
Description |
Permission |
/eshop |
Opens the main shop menu. |
lovelyenchant.open |
/eshop reload |
Reloads config.json. |
lovelyenchant.reload |
/eshopadmin edit |
Opens the Dialog API admin editor. |
lovelyenchant.edit |
/esa |
Alias for the admin editor. |
lovelyenchant.edit |
/disenchant |
Opens the disenchanting GUI. |
lovelyenchant.disenchant |
/enchanter <player> <enchant> <level> |
Adds an enchantment to a player's held item. |
lovelyenchant.enchanter |
Legacy enchantshop.* permission nodes are still accepted for compatibility.
Permissions
| Permission |
Default |
Description |
lovelyenchant.open |
true |
Allows /eshop and enchanting table redirect access. |
lovelyenchant.disenchant |
true |
Allows /disenchant. |
lovelyenchant.reload |
op |
Allows /eshop reload. |
lovelyenchant.enchanter |
op |
Allows /enchanter. |
lovelyenchant.edit |
op |
Allows /eshopadmin edit and /esa. |
lovelyenchant.buy.* |
op |
Allows buying any enchantment when per-enchant permissions are enabled. |
lovelyenchant.buy.<enchant_name> |
false |
Allows buying one enchantment when per-enchant permissions are enabled. |
lovelyenchant.admin |
op |
Grants reload, enchanter, edit, open, and wildcard buy permissions. |
Example per-enchant node:
lovelyenchant.buy.sharpness
Player Guide
Buying Enchantments
- Hold an enchantable item.
- Run
/eshop, or right-click an enchanting table.
- Click Cường hóa.
- Choose an enchantment.
- Choose a level.
- Pay the configured price.
Buying Enchanted Books
- Hold a normal book.
- Run
/eshop.
- Click Cường hóa.
- Choose an enchantment and level.
- One book is consumed, and an enchanted book is added to the inventory.
If enchantedBooksEnabled is false, players cannot create enchanted books.
Gambling Enchantments
- Hold an item that already has at least one enchantment.
- Run
/eshop.
- Click Cược vật phẩm.
- On success, the item gains a random new enchantment.
- On a jackpot, the item gains one extra random enchantment.
- On failure, all enchantments on the item are removed.
Disenchanting
- Hold an enchanted item.
- Run
/disenchant.
- Click the enchantment to remove.
- The enchantment is removed, and the player receives the configured refund.
Admin Editor
Run:
/esa
or:
/eshopadmin edit
The admin editor uses the Paper/Purpur Dialog API and saves changes directly to config.json.
Current editor panels:
- Economy & Books: cost formula, book purchases, book multiplier, enchanting table redirect, per-enchant permissions.
- Gambler: win chance and extra enchant chance.
- Disenchant: refund percentage.
- Menu Titles: GUI titles.
- Sounds: success, fail, and gamble sounds.
- Enchant Cost: set one enchantment base cost.
- Enchant Rules: set one enchantment max-level override and blacklist state.
- Message Text: edit any message key.
- Reload Config: reload config from disk.
Configuration
Config path:
plugins/LovelyEnchant/config.json
Generated defaults:
{
"costFormula": "base_cost * (level * level)",
"enchantmentBaseCosts": {
"minecraft:sharpness": 1000.0,
"minecraft:protection": 1200.0,
"minecraft:efficiency": 800.0,
"minecraft:unbreaking": 1500.0,
"minecraft:mending": 10000.0
},
"mainMenuTitle": "&8Menu chính",
"enchantSelectTitle": "&1Chọn Cường hóa",
"levelSelectTitle": "&1Chọn cấp Cường hóa",
"disenchantGUITitle": "&8Gỡ cường hóa",
"autoOpenEnchantingTable": true,
"enchantedBooksEnabled": true,
"enchantedBookCostMultiplier": 1.0,
"successSound": "ENTITY_PLAYER_LEVELUP",
"failSound": "ENTITY_VILLAGER_NO",
"gambleTickSound": "BLOCK_NOTE_BLOCK_HAT",
"gambleWinSound": "ENTITY_FIREWORK_ROCKET_TWINKLE",
"gambleLoseSound": "ENTITY_VILLAGER_DEATH",
"gambleDoubleSound": "UI_TOAST_CHALLENGE_COMPLETE",
"gambleChanceToWinPercent": 50,
"gambleChanceForSecondEnchantPercent": 20,
"messages": {
"prefix": "&8[&dCường hóa&8] &r",
"no_permission": "&cBạn không có quyền sử dụng lệnh này.",
"no_enchant_permission": "&cBạn không có quyền mua cường hóa này.",
"no_item_in_hand": "&cBạn phải cầm một vật phẩm!",
"item_not_enchantable": "&cVật phẩm trên tay bạn không thể cường hóa.",
"books_disabled": "&cTạo sách cường hóa hiện đang bị tắt.",
"not_enough_money": "&cBạn không đủ tiền! Cần &e{cost}&c.",
"enchant_success": "&aĐã cường hóa vật phẩm với &e{enchant} {level} &avới giá &e{cost}&a!",
"config_reloaded": "&aĐã tải lại cấu hình thành công!",
"disenchant_success": "&aĐã gỡ &e{enchant} {level} &avà hoàn lại &e{refund}&a!",
"item_not_disenchantable": "&cVật phẩm trên tay bạn không có cường hóa nào để gỡ.",
"gamble_no_enchants": "&cVật phẩm bạn đang cầm cần có ít nhất một cường hóa để cược!",
"gamble_no_available_enchants": "&cVật phẩm này không thể nhận thêm cường hóa ngẫu nhiên.",
"gamble_win": "&aTHẮNG! &fVật phẩm của bạn đã nhận &e{enchant} {level}&f!",
"gamble_win_extra": "&6TRÚNG LỚN! &fBạn nhận thêm cường hóa ngẫu nhiên: &e{enchant} {level}&f!",
"gamble_lose": "&cTHUA! &fTất cả cường hóa trên vật phẩm đã bị &cxóa&f!"
},
"perEnchantPermissions": false,
"enchantmentBlacklist": [
"minecraft:binding_curse"
],
"maxLevelOverrides": {},
"disenchantRefundPercentage": 50.0
}
Cost Formula
costFormula supports:
base_cost: the configured base cost for the selected enchantment
level: the selected enchantment level
Example:
"costFormula": "base_cost * (level * level)"
If minecraft:sharpness has a base cost of 1000, level 3 costs 9000.
Enchanted book prices use:
normal_cost * enchantedBookCostMultiplier
评论 0
登录后参与评分
还没有评论,来抢沙发吧