An open API service indexing awesome lists of open source software.

https://github.com/standardan/cratekeys

Reward crates with keys and an animated roulette opening for Paper 1.21+.
https://github.com/standardan/cratekeys

bukkit crates gui java minecraft minecraft-plugin paper paper-plugin rewards spigot

Last synced: 5 days ago
JSON representation

Reward crates with keys and an animated roulette opening for Paper 1.21+.

Awesome Lists containing this project

README

          

# CrateKeys

Reward **crates** with collectible keys and an **animated roulette** opening, for Paper 1.21+.
Bind any block as a crate, hand out keys, and let players right-click to spin for weighted rewards.

## Download

**[Download the latest release »](https://github.com/Standardan/cratekeys/releases/latest)**

Drop the `.jar` into your server's `plugins/` folder and restart. Requires Paper 1.21+ (Java 21).

## Features

- **Config-driven crates** — define crates, key items, and weighted reward tables in `config.yml`
- **Animated spin GUI** — icons scroll across a roulette and land on the winning reward, with sound
- **Tagged key items** — keys are identified by a PersistentDataContainer tag, not their name
- **Block-bound crates** — `/crate setblock ` turns any block into a crate; right-click with a key opens it
- **Weighted rewards** run as console commands (`give`, `eco`, anything), so rewards are unlimited
- The spin GUI is **click-locked** so players can't pull items out mid-animation

## Commands (`cratekeys.admin`, default op)

| Command | Description |
|---|---|
| `/crate givekey [amount]` | Give crate keys |
| `/crate setblock ` | Bind the block you're looking at as a crate |
| `/crate removeblock` | Unbind a crate block |
| `/crate reload` | Reload config |
| `/crate list` | List defined crates |

## Configuration

```yaml
crates:
vote:
display-name: "Vote Crate"
key-name: "Vote Key"
key-material: TRIPWIRE_HOOK
rewards:
- name: "16 Diamonds"
weight: 50 # relative odds
icon: DIAMOND
commands:
- "give %player% diamond 16"
```

## Design notes

- **The winner is decided before the animation starts** (`Crate#roll()` does a single weighted draw).
The roulette is pure presentation — it can't change the outcome, which keeps rewards honest and
the code simple.
- **The GUI is identified by a custom `InventoryHolder`** (`SpinGui`), so the click listener cancels
interaction by *type*, never by fragile title-string matching.
- **Animation runs on a repeating scheduler task** at a fixed tick interval and cancels itself when done.

## Building

JDK 21 + Maven. `mvn clean package` → `target/cratekeys-1.0.0.jar`.