Create wrench dupe guard

Stops players using a Create wrench to dismantle blocks and take their contents out of claims they can't build in. Server-side only.

Wrench Dupe Guard

Short summary

Stops players using a Create wrench to dismantle blocks and take their contents out of claims they can't build in. Server-side only.

Description

Wrench Dupe Guard closes a Create wrench exploit on servers that use land claims.

The problem

When you sneak + right-click with Create's wrench, some blocks get picked up straight into your inventory, with everything stored inside them. That path never asks claim mods for permission. Create checks permission on its main dismantle path, but not on its wrench-pickup path (blocks in #create:wrench_pickup). Many Create addon containers skip the check too.

So in someone else's claim, a player can wrench up blocks and take whatever is inside them. Depending on the claim mod and the block, this can also be used to duplicate items.

The fix

When a player sneak-uses any wrench (#c:tools/wrench) on a block, the mod first asks every protection mod whether that player may break the block. It does this with the same break check Create uses on its fixed path. If the answer is no, the wrench use is cancelled before Create or any addon gets to run, and the player sees "You can't dismantle blocks here."

  • Works with FTB Chunks, Open Parties and Claims, vanilla spawn protection, and any protection mod that cancels block breaking.
  • Covers every block and every wrench, including addon wrenches and addon containers, with no list to keep up to date.
  • Rotating blocks with a wrench still works everywhere by default. Only dismantling is blocked.
  • Players in creative mode are never blocked.
  • Players' own claims, and anywhere they are allowed to build, work exactly as before.

Config: config/wrenchdupeguard-common.toml

Option Default What it does
notifyBlockedPlayer true Shows an action-bar message when a dismantle is blocked
alsoGuardNonSneakWrench false Also blocks wrench rotations on blocks the player couldn't break

Requirements

  • Minecraft 1.21.1, NeoForge
  • Server-side only: players don't need it installed. It also works in single player.
  • Create is not a hard dependency: the guard reacts to anything tagged as a wrench.

Good to know

The permission check works by sending a test "block break" event, which is the same thing Create's own fixed code does. A mod that does something when it sees a break event (instead of only allowing or refusing it) would see that test event. It only happens on a sneaking wrench click on a block, so it's rare in practice.

MIT licensed.

Create wrench dupe guard Team

profile avatar
  • 9
    Projects
  • 832
    Downloads

More from FrontierCraftView all