附魔分离
用战锤敲击你的附魔物品,以移动/分离其附魔!
使用方法(游戏内)
- 将一件附魔物品和一件未附魔物品放置在附魔台上
- 用战锤敲击这些物品
- 就这么简单!附魔将被平均分配到两件物品上。
工作原理
当一件附魔物品和一件未附魔物品同时位于附魔台上时,会生成一个交互实体。在被击中的瞬间,游戏会检查附近是否有玩家手持战锤;如果有,则开始执行附魔分离流程。
- 原始附魔物品将被称为物品 0。
- 原始未附魔物品将被称为物品 1。
附魔分离流程
- 识别每件物品为物品 0 和物品 1,并打上相应的标签。这有助于简化后续命令中对它们的识别。
- 召唤一个盔甲架并将物品 0 克隆至其主手槽。该盔甲架用作附魔列表,一旦分离过程结束即被销毁。
- 移除物品 0 上的所有附魔。
- 启动一个计分板切换机制,决定哪件物品接收下一个附魔。此过程始终从物品 1 开始。
- 开始分配附魔。
- 分配完成后,杀死盔甲架和交互实体,并移除相关物品上的标签。
分配机制
- 已创建一个包含所有原版附魔的注册表。
- 对于注册表中的每个附魔,都会运行一个函数,将其值存储为盔甲架上的分数。如果分数大于 0,则该附魔存在于附魔列表中。
- 如果存在某个附魔,则会运行一个函数,将该附魔的值复制到目标物品上,从附魔列表中移除它,并切换下一件接收附魔的物品。
- 在检查完注册表中所有附魔后,附魔列表中剩余的所有附魔都将被合并到物品 1 上。
所有这些操作都在单个游戏刻内完成。
常见问题解答
如果我对只有一项附魔的物品进行“分离”会发生什么?
该项附魔会从物品 0 移动到物品 1。
我可以将附魔跨不同物品分离吗(例如,将多把剑的附魔分散到钻石剑和下界合金剑之间)?
可以。
我可以将附魔分离到无法接受某些附魔的物品上吗(例如,将无限附魔分离到弩上)?
可以。
我可以将附魔分离到通常无法附魔的物品上吗(例如,将击退附魔分离到木棍上)?
可以。
Enchantment Splitting
Hit your enchanted items with a mace to move/split their enchantments!
How to use (in-game)
- Drop an enchanted item and an unenchanted item onto an enchanting table
- Hit the items with a mace
- That's it! The enchantments will be evenly distributed across both items.
How it works
An interaction entity is spawned whenever an enchanted and unenchanted item are on top of an enchanting table at the same time. The instant it is hit, the game checks to see if a nearby player is holding a mace, and if so, it begins the enchantment splitting process.
- The originally enchanted item will be referred to as item 0.
- The originally unenchanted item will be referred to as item 1.
Enchantment Splitting Process
- Identify each item as item 0 and item 1, and tag them accordingly. This is to simplify identifying them in future commands.
- Summon an armor stand and clone item 0 to its mainhand. This armor stand is used as an enchantment list, and will be destroyed as soon as the splitting process is over.
- Remove all enchantments from item 0.
- Initiate a scoreboard toggle that decides which item receives the next enchantment. This always begins with item 1.
- Begin distributing.
- After distribution is complete, kill the armor stand and interaction entity, and remove tags from the items involved.
Distribution
- A registry has been made containing all vanilla enchantments.
- For each enchantment in the registry, a function is run storing its value as a score on the armor stand. If the score is greater than 0, the enchantment is present on the enchantment list.
- If an enchantment is present, a function is run to copy the enchantment's value to the item, remove it from the enchantment list, and toggle which item gets the next enchantment.
- Once all enchantments in the registry have been checked, all remaining enchantments on the enchantment list are merged to item 1.
All of this happens within a single game tick.
Quick Answers
What happens if I "split" an item with only one enchantment?
The enchantment is moved from item 0 to item 1.
Can I split enchantments across different items (e.g. splitting multiple sword enchantments across a Diamond Sword and Netherite Sword)?
Yes.
Can I split enchantments onto items that can't have certain enchantments (e.g. splitting Infinity onto a Crossbow)?
Yes.
Can I split enchantments onto items that can't normally be enchanted (e.g. splitting Knockback onto a Stick)?
Yes.
评论 0
登录后参与评分
还没有评论,来抢沙发吧