xDupe
xDupe 是一个轻量级、开源的 Paper 插件,为无政府状态服务器恢复了经典的活塞-物品展示框复制机制。该机制最初被 Mojang 和 Paper 修复,此插件经过精心重新实现,以绕过现代反复制保护,同时保持完整的 NBT 完整性。支持通过文件和游戏内命令进行完全配置。
- 作者: EMIRLQQ1
- 语言: Java 17+
- 平台: Paper 1.20 – 1.21.x (Spigot API)
- 许可证: MIT
目录
功能
- 经典复制机制 – 活塞推入物品展示框 → 物品被复制。行为与 1.20 之前的原版行为完全一致,但效果更佳。
- 发光物品展示框支持 – 完全兼容普通物品展示框和发光物品展示框。
- 完整 NBT 保留 – 附魔、自定义名称、描述、属性、药水效果以及所有其他 NBT 数据在每次复制的物品中都会得到保留。
- 可配置的几率 – 设置复制成功率为 0% 到 100%。当几率失败时,物品展示框会自然破碎,仿佛什么都没发生一样。
- 可配置的数量 – 控制掉落额外副本的数量。设置为 0 则完全不复制,或设置高值以实现极端复制。
- 可配置的展示框掉落 – 选择物品展示框本身在破碎时是否作为物品掉落。
- 游戏内配置 – 使用简单的命令即时更改所有设置。无需重启服务器。
- Tab 补全 – 对每个命令和值都支持完整的 Tab 补全。
- 反反复制 – 以
EventPriority.LOWEST(最低优先级)运行,并立即移除物品展示框,以防止反作弊插件干扰。
- 性能优化 – 使用带有边界框过滤的
getNearbyEntities,而不是扫描整个世界。开销极小。
- Adventure API – 基于 Paper 的现代 Adventure API 构建,确保跨版本的聊天格式可靠。
工作原理
┌─────────────────────┐
│ 活塞伸出 │
└──────────┬──────────┘
│
┌──────────v──────────┐
│ 找到物品展示框 │
│ 位于活塞前方 │
└──────────┬──────────┘
│
┌──────────v──────────┐
│ 展示框内有物品吗? │
└──────┬──────────┬───┘
│ │
是 否
│ │
┌──────────v──┐ │
│ 几率 │ │
│ 检查 │ │
└──────┬──────┘ │
│ │
┌───────┴───────┐ │
│ │ │
成功 失败 │
│ │ │
┌───────v───────┐ │ │
│ 掉落原始物品 │ │ │
│ + 额外副本 │ │ │
│ (+ 如果启用 │ │ │
│ 则掉落展示框)│ │ │
└───────┬───────┘ │ │
│ │ │
┌───────v───────┐ │ │
│ 从世界中移除 │ │ │
│ 展示框 │ │ │
└───────┬───────┘ │ │
│ │ │
└──────┬───────┘ │
│ │
┌──────v──────┐ │
│ 完成 │ │
└────────────┘ │
┌──────────v──────────┐
│ 自然破碎 │
│ (原版行为) │
└─────────────────────┘
技术细节
当活塞伸出时,服务器会触发 BlockPistonExtendEvent。xDupe 监听 EventPriority.LOWEST(最低优先级)——在任何反作弊或反复制插件有机会取消事件之前。在此阶段:
- 插件计算活塞头将要占据的方块位置。
- 使用边界框查询(半径为 0.75 的
getNearbyEntities)在该确切方块位置搜索物品展示框。
- 如果找到带有物品的物品展示框,则进行配置的几率判定。
- 成功时:使用
ItemStack.clone() 克隆物品,这将复制所有 NBT 数据,包括附魔、自定义名称、描述和属性。
- 原始物品以及配置数量的副本将在展示框的位置使用
dropItemNaturally 掉落。
- 如果启用了
drop-frame(掉落展示框),物品展示框本身也会被掉落。
- 展示框实体将立即从世界中移除(使用
remove()),防止任何其他插件干扰或产生额外的掉落物。
- 失败时:插件不执行任何操作,展示框将按照原版行为自然破碎。
安装
步骤 1:下载
从 Releases 页面下载最新的 xDupe.jar。
步骤 2:安装
将 xDupe.jar 文件放入服务器的 plugins/ 目录中。
server/
├── plugins/
│ ├── xDupe.jar ← 放置于此
│ ├── ...
│ └── ...
├── world/
├── world_nether/
├── world_the_end/
├── server.properties
├── ...
步骤 3:启动或重载
完全重启服务器,或者如果您使用的是 Paper 1.20+,可以使用以下命令:
/reload confirm
第 4 步:验证
在游戏中或从控制台运行此命令:
/xdupe
你应该能看到 xDupe 的状态屏幕,其中显示默认配置值。
要求
| 依赖项 |
最低版本 |
| 服务端 |
Paper 1.20(或任何兼容 Paper 的分支) |
| Java |
Java 17(JDK 17 或更高版本) |
配置
首次运行时,xDupe 会自动创建 plugins/xDupe/config.yml。
默认配置
chance: 100
duplicate-amount: 1
drop-frame: true
选项参考
| 选项 |
类型 |
默认值 |
范围 |
描述 |
chance |
int |
100 |
0 – 100 |
复制触发的概率百分比。设为 100 时始终触发,设为 0 时从不触发。 |
duplicate-amount |
int |
1 |
0 – ∞ |
在原物品之上额外掉落的副本数量。总掉落物品数 = 1(原物品)+ duplicate-amount。 |
drop-frame |
boolean |
true |
true / false |
当复制触发时,物品框本身是否作为物品掉落。 |
示例
公平无政府状态(50% 概率,1 个额外副本)
chance: 50
duplicate-amount: 1
drop-frame: true
极端超模(100% 概率,10 个额外副本)
chance: 100
duplicate-amount: 10
drop-frame: false
已禁用(关闭复制)
chance: 0
duplicate-amount: 0
drop-frame: false
原版风格(100% 概率,无额外副本,但物品框掉落)
chance: 100
duplicate-amount: 0
drop-frame: true
命令
| 命令 |
描述 |
权限 |
/xdupe |
显示帮助菜单和当前配置 |
xdupe.admin |
/xdupe help |
显示帮助菜单和当前配置 |
xdupe.admin |
/xdupe chance [value] |
查看或设置复制概率(0–100) |
xdupe.admin |
/xdupe amount [value] |
查看或设置额外副本数量(≥0) |
xdupe.admin |
/xdupe dropframe [true|false] |
查看或设置是否掉落物品框 |
xdupe.admin |
/xdupe reload |
从 config.yml 重新加载配置 |
xdupe.admin |
别名: /dupe
使用示例
/xdupe
── 显示当前设置和所有可用命令
/xdupe chance
── 显示当前概率值(例如,“current chance: 100%”)
/xdupe chance 50
── 将概率设置为 50%
/xdupe amount 3
── 将 duplicate-amount 设置为 3(每次复制总共掉落 4 个物品)
/xdupe dropframe false
── 禁用物品框掉落
/xdupe reload
── 从磁盘重新加载 config.yml
注意: 所有命令都支持自动补全。开始输入并按 Tab 键即可查看建议。
权限
| 权限 |
默认值 |
描述 |
xdupe.admin |
op |
允许使用所有 /xdupe 命令 |
向非 OP 玩家授予权限的示例:
/manadd PlayerName xdupe.admin
从源代码构建
前置条件
- Java 17 或更高版本(JDK)
- Apache Maven 3.8+
导入到 IntelliJ IDEA
- 打开 IntelliJ IDEA
- 点击 File → Open(文件 → 打开)
- 选择
xDupe 目录
- IntelliJ 将自动检测 Maven 项目并导入依赖项
- 使用 Maven 侧边栏运行 Package(打包),或在终端中运行
mvn clean package
支持版本
| Minecraft 版本 |
Paper 支持 |
状态 |
| 1.20 |
✅ |
完全测试通过 |
| 1.20.1 |
✅ |
完全测试通过 |
| 1.20.2 |
✅ |
完全测试通过 |
| 1.20.3 |
✅ |
完全测试通过 |
| 1.20.4 |
✅ |
完全测试通过 |
| 1.20.5 |
✅ |
兼容 |
| 1.20.6 |
✅ |
兼容 |
| 1.21 |
✅ |
兼容 |
| 1.21.1 |
✅ |
兼容 |
| 1.21.2+ |
✅ |
应该可以工作(API 稳定) |
任何兼容 Paper 的分支(如 Purpur、Pufferfish 等)也应该可以正常工作。
故障排除
插件未加载
- 确保你使用的是 Paper,而不是 CraftBukkit 或 Spigot(xDupe 使用了 Paper 特定的 API)。
- 检查你是否安装了 Java 17 或更高版本。
- 验证 JAR 文件未损坏,请检查其大小(应为 ~5-10 KB)。
- 查看服务器控制台是否有错误消息。
复制不起作用
- 确认
chance 设置为大于 0 的值。
- 确保物品框中确实包含物品(用物品右键点击物品框)。
- 检查活塞是否正对着物品框——活塞头必须延伸到物品框所在的精确方块位置。
- 尝试设置
chance: 100 和 drop-frame: true 进行测试。
- 如果其他插件造成干扰,请尝试暂时禁用其他反复制插件。
命令未找到
- 验证插件是否成功加载:
/plugins 列表中应显示 xDupe。
- 如果使用
/dupe 别名且无法工作,请直接尝试 /xdupe。
- 确保你拥有
xdupe.admin 权限。
物品丢失附魔或数据
- 这不应该发生——xDupe 使用
ItemStack.clone(),它会保留所有 NBT 数据。
- 如果你遇到数据丢失问题,可能是其他插件在物品掉落后修改了它们。
常见问题
问:这会被封禁吗?
答:在无政府状态服务器上不会。这就是制作这个插件的目的。在原版或生存服务器上,复制通常违反规则。
问:这在 Spigot 上能用吗?
答:它在 Spigot 上应该也能工作,但推荐使用 Paper。该插件使用了带有谓词过滤器的 Paper 的 getNearbyEntities,Spigot 上也有此功能。然而,反复制绕过功能是专门为 Paper 内置的保护机制设计的。
问:我可以将此与其他复制插件一起使用吗?
答:可以,但请注意它们可能会发生冲突。如果使用多个复制插件,请先将它们放在一起测试。
问:这个能复制潜影盒及其内容物吗?
答:是的!由于 ItemStack.clone() 会保留所有 NBT 数据,潜影盒的内容物、已书写的书、附魔物品以及任何其他 NBT 数据都会完全复制。
问:如何将配置重置为默认值?
答:删除 plugins/xDupe/config.yml 并运行 /xdupe reload 或重启服务器。将会生成一个新的配置文件。
问:物品会消失吗?
答:复制出的物品属于普通掉落物,遵循 Minecraft 标准的消失计时器(默认 5 分钟)。此行为不由 xDupe 控制。
注意事项
- 用途: 该插件故意重现了被 Mojang 和 Paper 修复的复制机制。它仅适用于允许复制作为玩法一部分的无政府/混乱服务器。
- 反复制绕过: 该插件通过以
EventPriority.LOWEST(最低优先级)运行,并在任何反作弊插件做出反应之前移除物品展示框实体来工作。这是一种绕过手段,而非修复——其设计目的是规避保护机制。
- 性能: xDupe 使用有界实体查询(半径为 0.75 格的
getNearbyEntities),而非扫描所有已加载的实体。这意味着在正常游戏过程中对性能影响几乎为零。唯一的开销出现在活塞实际靠近物品展示框延伸时。
- 服务器日志: 为避免控制台被刷屏,该插件不会记录单个复制事件。仅记录启用/禁用消息。
- 修改: 本项目基于 MIT 许可证开源。欢迎随意修改、重新分发和使用。
许可证
MIT License
Copyright (c) 2026 EMIRLQQ1
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
xDupe — 由 EMIRLQQ1 ❤️ 制作
xDupe
xDupe is a lightweight, open-source Paper plugin that brings back the classic piston-item frame duplication mechanic for anarchy servers. Originally patched by both Mojang and Paper, this mechanic is carefully re-implemented to bypass modern anti-dupe protections while keeping full NBT integrity. Fully configurable via both file and in-game commands.
- Author: EMIRLQQ1
- Language: Java 17+
- Platform: Paper 1.20 – 1.21.x (Spigot API)
- License: MIT
Table of Contents
Features
- Classic Dupe Mechanic – Piston extends into an item frame → item is duplicated. Works exactly like the pre-1.20 vanilla behavior, but better.
- Glow Item Frame Support – Fully compatible with both normal item frames and glow item frames.
- Full NBT Preservation – Enchantments, custom names, lore, attributes, potion effects, and all other NBT data are preserved on every duplicated item.
- Configurable Chance – Set the duplication success rate from 0% to 100%. When the chance fails, the item frame breaks naturally as if nothing happened.
- Configurable Amount – Control how many extra copies are dropped. Set to 0 for no duplication at all, or set high values for extreme duplication.
- Configurable Frame Drop – Choose whether the item frame itself drops as an item when broken.
- In-Game Configuration – Change all settings on the fly with simple commands. No server restarts required.
- Tab Completion – Full tab completion support for every command and value.
- Anti-Anti-Dupe – Runs at
EventPriority.LOWEST and removes the item frame instantly to prevent anti-cheat plugins from interfering.
- Performance Optimized – Uses
getNearbyEntities with bounding box filtering instead of scanning the entire world. Minimal overhead.
- Adventure API – Built with Paper's modern Adventure API for reliable cross-version chat formatting.
How It Works
┌─────────────────────┐
│ Piston Extends │
└──────────┬──────────┘
│
┌──────────v──────────┐
│ Item Frame Found │
│ in front of piston │
└──────────┬──────────┘
│
┌──────────v──────────┐
│ Frame has item? │
└──────┬──────────┬───┘
│ │
yes no
│ │
┌──────────v──┐ │
│ Chance │ │
│ Check │ │
└──────┬──────┘ │
│ │
┌───────┴───────┐ │
│ │ │
success failed │
│ │ │
┌───────v───────┐ │ │
│ Drop original │ │ │
│ + extra copies │ │ │
│ (+ frame if │ │ │
│ enabled) │ │ │
└───────┬───────┘ │ │
│ │ │
┌───────v───────┐ │ │
│ Remove frame │ │ │
│ from world │ │ │
└───────┬───────┘ │ │
│ │ │
└──────┬───────┘ │
│ │
┌──────v──────┐ │
│ Done │ │
└────────────┘ │
┌──────────v──────────┐
│ Natural Break │
│ (vanilla behavior) │
└─────────────────────┘
Technical Details
When a piston extends, the server fires a BlockPistonExtendEvent. xDupe listens at EventPriority.LOWEST — before any anti-cheat or anti-dupe plugin has a chance to cancel the event. At this point:
- The plugin calculates the block position the piston head will occupy.
- It searches for item frames at that exact block location using a bounding box query (
getNearbyEntities with 0.75 radius).
- If an item frame with an item is found, the configured chance is rolled.
- On success: the item is cloned with
ItemStack.clone(), which copies all NBT data including enchantments, custom names, lore, and attributes.
- The original item, plus the configured number of duplicates, are dropped at the frame's location using
dropItemNaturally.
- If
drop-frame is enabled, the item frame itself is also dropped.
- The frame entity is immediately removed from the world with
remove(), preventing any other plugin from interfering or creating additional drops.
- On failure: the plugin does nothing, and the frame breaks naturally with vanilla behavior.
Installation
Step 1: Download
Download the latest xDupe.jar from the Releases page.
Step 2: Install
Place the xDupe.jar file into your server's plugins/ directory.
server/
├── plugins/
│ ├── xDupe.jar ← place here
│ ├── ...
│ └── ...
├── world/
├── world_nether/
├── world_the_end/
├── server.properties
├── ...
Step 3: Start or Reload
Restart your server completely, or if you're on Paper 1.20+, use:
/reload confirm
Step 4: Verify
Run this command in-game or from the console:
/xdupe
You should see the xDupe status screen with default configuration values.
Requirements
| Dependency |
Minimum Version |
| Server |
Paper 1.20 (or any Paper-compatible fork) |
| Java |
Java 17 (JDK 17 or higher) |
Configuration
On first run, xDupe creates plugins/xDupe/config.yml automatically.
Default Configuration
chance: 100
duplicate-amount: 1
drop-frame: true
Options Reference
| Option |
Type |
Default |
Range |
Description |
chance |
int |
100 |
0 – 100 |
The percentage chance that the duplication will trigger. At 100, it always triggers. At 0, it never triggers. |
duplicate-amount |
int |
1 |
0 – ∞ |
How many EXTRA copies are dropped on top of the original item. Total items dropped = 1 (original) + duplicate-amount. |
drop-frame |
boolean |
true |
true / false |
Whether the item frame itself drops as an item when the dupe triggers. |
Examples
Fair Anarchy (50% chance, 1 extra copy)
chance: 50
duplicate-amount: 1
drop-frame: true
Extreme Overpowered (100% chance, 10 extra copies)
chance: 100
duplicate-amount: 10
drop-frame: false
Disabled (duplication off)
chance: 0
duplicate-amount: 0
drop-frame: false
Vanilla-Like (100% chance, no extra, but frame drops)
chance: 100
duplicate-amount: 0
drop-frame: true
Commands
| Command |
Description |
Permission |
/xdupe |
Display help menu and current configuration |
xdupe.admin |
/xdupe help |
Display help menu and current configuration |
xdupe.admin |
/xdupe chance [value] |
View or set the duplication chance (0–100) |
xdupe.admin |
/xdupe amount [value] |
View or set the number of extra copies (≥0) |
xdupe.admin |
/xdupe dropframe [true|false] |
View or set whether the frame drops |
xdupe.admin |
/xdupe reload |
Reload configuration from config.yml |
xdupe.admin |
Alias: /dupe
Usage Examples
/xdupe
── shows current settings and all available commands
/xdupe chance
── shows current chance value (e.g., "current chance: 100%")
/xdupe chance 50
── sets chance to 50%
/xdupe amount 3
── sets duplicate-amount to 3 (total 4 items per dupe)
/xdupe dropframe false
── disables frame dropping
/xdupe reload
── reloads config.yml from disk
Note: All commands have tab completion. Start typing and press Tab to see suggestions.
Permissions
| Permission |
Default |
Description |
xdupe.admin |
op |
Allows using all /xdupe commands |
Example for granting to a non-op player:
/manadd PlayerName xdupe.admin
Building from Source
Prerequisites
- Java 17 or higher (JDK)
- Apache Maven 3.8+
Importing into IntelliJ IDEA
- Open IntelliJ IDEA
- Click File → Open
- Select the
xDupe directory
- IntelliJ will automatically detect the Maven project and import dependencies
- Use the Maven sidebar to run Package or run
mvn clean package in the terminal
Supported Versions
| Minecraft Version |
Paper Support |
Status |
| 1.20 |
✅ |
Fully tested |
| 1.20.1 |
✅ |
Fully tested |
| 1.20.2 |
✅ |
Fully tested |
| 1.20.3 |
✅ |
Fully tested |
| 1.20.4 |
✅ |
Fully tested |
| 1.20.5 |
✅ |
Compatible |
| 1.20.6 |
✅ |
Compatible |
| 1.21 |
✅ |
Compatible |
| 1.21.1 |
✅ |
Compatible |
| 1.21.2+ |
✅ |
Should work (API stable) |
Any Paper-compatible fork (Purpur, Pufferfish, etc.) should work as well.
Troubleshooting
Plugin doesn't load
- Make sure you're using Paper, not CraftBukkit or Spigot (xDupe uses Paper-specific APIs).
- Check that you have Java 17 or higher installed.
- Verify that the JAR file is not corrupted by checking its size (should be ~5-10 KB).
- Check the server console for any error messages.
Dupe isn't working
- Confirm that
chance is set to a value greater than 0.
- Make sure the item frame actually contains an item (right-click the frame with an item).
- Check that the piston is facing directly toward the item frame — the piston head must extend into the exact block where the frame is located.
- Try setting
chance: 100 and drop-frame: true for testing.
- If another plugin is interfering, try disabling other anti-dupe plugins temporarily.
Command not found
- Verify that the plugin loaded successfully:
/plugins should show xDupe in the list.
- If using
/dupe alias and it doesn't work, try /xdupe directly.
- Make sure you have the
xdupe.admin permission.
Items lose enchantments or data
- This should not happen — xDupe uses
ItemStack.clone() which preserves all NBT data.
- If you're experiencing data loss, it may be caused by another plugin modifying items after they drop.
FAQ
Q: Is this bannable?
A: On anarchy servers, no. That's what this plugin is made for. On vanilla or survival servers, duplication is typically against the rules.
Q: Does this work with Spigot?
A: It should work on Spigot too, but Paper is recommended. The plugin uses Paper's getNearbyEntities with a predicate filter, which is available on Spigot as well. However, the anti-dupe bypass is specifically designed for Paper's built-in protections.
Q: Can I use this with other dupe plugins?
A: Yes, but be aware they may conflict. If using multiple dupe plugins, test them together first.
Q: Does this dupe shulker boxes with their contents?
A: Yes! Since ItemStack.clone() preserves all NBT data, shulker box contents, written books, enchanted items, and any other NBT data are all fully duplicated.
Q: How do I reset the config to default?
A: Delete plugins/xDupe/config.yml and run /xdupe reload or restart the server. A fresh config will be generated.
Q: Will items despawn?
A: Duplicated items are regular dropped items and follow standard Minecraft despawn timers (5 minutes by default). This is not controlled by xDupe.
Notes
- Purpose: This plugin deliberately recreates a duplication mechanic that was patched by both Mojang and Paper. It is intended only for anarchy / chaos servers where duplication is part of the gameplay.
- Anti-Dupe Bypass: The plugin works by running at
EventPriority.LOWEST and removing the item frame entity before any anti-cheat plugin can react. This is a bypass, not a fix — it's designed to circumvent protections.
- Performance: xDupe uses bounded entity queries (
getNearbyEntities with a 0.75-block radius) rather than scanning all loaded entities. This means near-zero performance impact during normal gameplay. The only cost is when a piston actually extends near an item frame.
- Server Logging: The plugin does not log individual dupe events to avoid filling the console. Only enable/disable messages are logged.
- Modification: This is open source under the MIT license. Feel free to modify, redistribute, and use as you wish.
License
MIT License
Copyright (c) 2026 EMIRLQQ1
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
xDupe — Made with ❤️ by EMIRLQQ1
评论 0
登录后参与评分
还没有评论,来抢沙发吧