这是一个适用于 1.21 及以上版本的 datapack(数据包)。它添加了一个简单的附魔,保护附魔物品在死亡时不会掉落。
这个数据包受到之前版本中类似模组和数据包的启发。我在 1.21 中使用新的数据驱动附魔功能没有找到现成的解决方案,因此我决定为自己制作一个,力求保持其尽可能简单和易于理解。
默认情况下,此附魔无法在生存模式中获得,主要用于服务器、地图、整合包和其他项目等实用场景。未来我可能会创建一个可通过附魔获得的替代版本,但现阶段你可以自由下载此版本并自行将其添加到可获得的附魔标签中,操作并不复杂。
具有耐久度的物品在死亡时会损失 20% 的耐久度,因此死亡并非没有代价。然而,这种伤害永远不会使物品完全损坏。重生后你会听到一个小提示音,表示物品已返还给你。
该数据包需要强制加载坐标 (0,0) 所在的区块才能正常工作。这将在加载时自动完成。在服务器上,出生点区块默认始终处于加载状态,因此这对服务器没有影响;但在单人游戏中可能会有极其轻微的影响。
兼容 keepinventory 命令(此时附魔将无效)。可能与 doimmediaterespawn 不兼容。物品根据玩家的 UUID 归属并返还给玩家,因此在离线模式服务器上可能会失效。
由于虚空会在单个刻内删除物品,此附魔无法保护物品免受虚空死亡的伤害。 这个问题未来可能会修复,但目前较为棘手。
想直接提问?我没有 Discord 服务器,但你可以通过消息请求联系 @livelaughlord

This is a datapack for versions 1.21 and above. It adds a simple enchantment which protects enchanted items from being dropped on death.
This datapack is inspired by similar mods and datapacks for previous versions. I couldn't find one using the new data-driven enchantment functionality in 1.21 so I decided to make it for myself with the aim of keeping it as simple and understandable as possible.
This enchantment cannot be obtained in survival by default, and is intended more as a utility for servers, maps, packs and other projects. I may create an alt version which is obtainable through enchanting in the future, but for now you're free to download this version and add it to the obtainable enchantment tags yourself, it's not too difficult to do.
Items with durability will lose 20% of their durability upon death, so dying doesn't come without drawbacks. However, this damage will never fully break the item. You will hear a small noise on respawn to signify that items have been returned to you.
This datapack requires the chunk at 0,0 to be force-loaded to function correctly. This will be done automatically on load. On a server, spawn chunks are always loaded by default so this should make no difference, however this may have a very minor impact in singleplayer.
Compatible with keepinventory (enchantment will have no effect). Will likely break with doimmediaterespawn. Items are attributed to and returned to players based on their UUID, so will likely break on offline-mode servers.
Due to how the void deletes items after a single tick, this enchantment will NOT protect items from death to the void. This may be fixed in the future, but its tricky.
Want to ask questions directly? I don't have a discord server, but you can send me a message request @livelaughlord

评论 0
登录后参与评分
还没有评论,来抢沙发吧