Closes duplication glitches that still work in vanilla, each with its own switch. Made for servers: nothing is needed on the client.
NeoForge port of Panda Anti-Dupe by TreeOfSelf, which is Fabric only. For NeoForge 1.21.1, 1.21.11, 26.2 and 26.3. Please report bugs here.
What it patches
Trident dupe (1.21.1, on by default). While charging a trident, a player swaps it into the crafting grid or an open chest and lets go in the same moment. The game throws a copy and the original stays in the chest. Clicks in inventories are now ignored while a trident is being charged.
Book dupe (1.21.1, on by default). A modified client can sign a book with a title up to 128 characters long, but the game can only save titles up to 32. The player holding it can't be saved anymore, so on relog they roll back to their last save, while the chest they filled keeps everything. Titles over 32 characters are now refused.
Sand dupe (all versions, off by default). Sand, gravel, concrete powder and other falling blocks that go through an end portal also land where they left, in the same tick. Mojang keeps this on purpose and plenty of players run sand dupers, so this one is off unless you turn it on.
On 1.21.11 and 26.x vanilla already stops the trident and book dupes, so only the sand switch does anything there.
Not included
Panda Anti-Dupe has more patches. I left out every one that I couldn't reproduce on vanilla with a test, or that vanilla has fixed by now: shulker box, horse inventory, hopper, lectern, bee, the piston TNT, rail and carpet dupers, and a few more. If you know a setup that still dupes on one of these versions, open an issue with the steps and I'll add a patch for it.
Config
config/dupepatches.properties has a true/false switch for each patch.
FAQ
Client or server? Only the server needs it (or your game, in singleplayer). Players can join without it.
Does it need anything else? No.
How is it tested? Every patch has a game test that reproduces the dupe on a test server, once with the patch on, where nothing may be duplicated, and once with the patch off for that one player or block, where the dupe has to happen. That way the test proves the dupe is real and that the patch is what stops it. They run on all four Minecraft versions.
Can I use it in my modpack? Yes, go ahead, no need to ask.
CC0, like the original. Developed with AI assistance. Source: https://github.com/traelmyx/dupe-patches

