BlueGit

timfa copper-key

Files

copper-key
README.md

CopperKeys

Paper 26.2 plugin that adds a non-stackable key item and event-driven locks for containers and openable blocks.

Requirements

  • Paper 26.2
  • Java 25
  • Resource pack in resource-pack/

Build

gradle clean build

The plugin jar is created in build/libs/.

Resource pack

Zip the contents of resource-pack/ so pack.mcmeta is at the root of the zip. A ready-to-use zip is distributed alongside the source archive.

The supplied texture is the user's 16x16 key sprite and is selected through the minecraft:item_model component (copperkeys:key).

Behaviour

  • Two copper nuggets placed diagonally craft a Blank Key.
  • Keys have max stack size 1.
  • Right-click a supported unlocked block with a Blank Key to bind it.
  • Bound keys display Unlocks <block name>.
  • Containers require the matching key somewhere in the player's inventory, including recursively inside Bundles and Shulker Boxes.
  • Locked doors/trapdoors/fence gates may always be closed, but cannot be opened without the matching key. Redstone may close them but may not open them.
  • Hopper transfers, hopper pickup/search and Copper Golem target validation are denied for locked containers.
  • Breaking either half of a double chest or either half of a door breaks the binding.
  • Keys found online are immediately blanked when their bound block is broken. Keys elsewhere are lazily blanked the next time the plugin encounters them.
  • No periodic world or inventory scan is used.

Persistence

Block bindings are stored in plugins/CopperKeys/locks.yml. The binding UUID itself is stored on the key item using the Persistent Data Container.