make me a mod for 26.1.2 java that works on servers and client side that adds back the old 1.17 anvil dupe glitch
KodariJun 27 at 5:53 pm 23
AnvilDupeMod
Recreates the classic Minecraft 1.17 anvil duplication glitch for 1.21.11. When a player uses an anvil and the anvil breaks from durability loss, the input items are returned alongside the output item, effectively duplicating them. Works on both client and server. Useful for nostalgia servers or survival gameplay that wants the old exploit restored as a feature.
Here’s my plan:
Mixin into AnvilScreenHandler#onTakeOutput
Save copies of input slots at HEAD
At RETURN, check if the anvil block still exists — if it broke, give the inputs back (the dupe)
The mod works by:
Saving copies of both anvil input slots before onTakeOutput runs (which clears them)
After the operation, checking if the anvil block at the handler’s position is gone (broke from durability)
If it broke, inserting the saved input copies into the player’s inventory (or dropping them if full)
The check is server-side only (ServerPlayerEntity), so there are no client ghost items — the server authoritatively handles the duplication exactly as the original 1.17 bug did.
R
I didn't have an option in the menu for 26?1.12
Kodari can make mistakes. Review important code before using.