JPCrates
Crates with five crate types, animations without a resource pack, pity, keys and an in-game editor.
Downloads open soon.
Features
- Five crate types: normal, pick, mystery, bundle and gamble
- Spin and roll animations without a resource pack
- Rarities, pity (a guaranteed rare after a number of tries) and a reward preview
- Virtual and physical keys, mass opening with sneak + right-click
- Holograms above crates
- In-game crate editor
- Events for other plugins
Requirements
- Paper 26.1 or newer (Java 25)
- Optional:
- Vault: money (any Vault economy)
- PlaceholderAPI: placeholders in texts, and this plugin's own placeholders
- JPCosmetics: cosmetics as rewards
Installation
- Put
JPCrates-<version>.jarin your server'spluginsfolder. - Restart the server.
plugins/JPCrates/is created with the config and messages. - Change what you want in the files, then reload or restart.
Type /jp as an operator to see every JP plugin you have installed, its version and which optional plugins it found.
Commands
| Command | Description | Permission |
|---|---|---|
/crate [preview|open|free|buy|claim|keys|help]Aliases: /crates, /jpcrates | Crates, keys and the crate editor. | jpcrates.use |
/keys | Your keys for every crate. | jpcrates.use |
Permissions
| Permission | Default | Description |
|---|---|---|
jpcrates.use | everyone | Open crates, preview them and see your keys. |
jpcrates.massopen | everyone | Sneak + right-click to open many keys at once. |
jpcrates.open.anywhere | operators | Open any crate from /crates without walking to it. |
jpcrates.admin | operators | Give keys, place crates, the editor and reload. |
Placeholders
Needs PlaceholderAPI.
| Placeholder | Shows |
|---|---|
%jpcrates_keys_<crate>% | virtual keys |
%jpcrates_physical_<crate>% | key items in the inventory |
%jpcrates_total_<crate>% | both together |
%jpcrates_opened_<crate>% | how often the reader opened it |
%jpcrates_opened% | crates the reader opened in total |
%jpcrates_pity_<crate>% | rolls left until the pity reward |
%jpcrates_free_<crate>% | time until the free key ("ready" / "-") |
%jpcrates_server_opened_<crate>% | how often everyone opened it |
%jpcrates_last_winner_<crate>% | the last player who won from it |
%jpcrates_last_reward_<crate>% | the last reward won from it |
For developers
Add softdepend: [JPCrates] to your plugin.yml.
| Event | When |
|---|---|
com.jp.crates.api.CrateOpenEvent | A player is about to open a crate. Cancel it and they keep their key. |
com.jp.crates.api.CrateRewardEvent | A player was given a reward: crate id, reward id, rarity and the reward's item. |
Configuration
All files are in plugins/JPCrates/. Files: config.yml, crates.yml, menus.yml, messages.yml.
When you update the plugin, new options are added to your config.yml by themselves, with their comments. Your own settings stay as they are, and the old file is kept as config.old-v<number>.yml.
Languages: English, Spanish, Portuguese, French and German. Set language: in config.yml (en, es, pt, fr or de).
Default config.yml
# Used to add new options to this file after an update. Don't change it.
config-version: 1
# ╔══════════════════════════════════════════════════════════════════╗
# ║ JPCrates · config.yml ║
# ╚══════════════════════════════════════════════════════════════════╝
# Crates with five crate types, animations without a resource pack, pity and keys.
# The crates themselves are in crates.yml (or build them in game: /crate editor).
# examples/crates.yml has ready-made crates to copy from. How /crates and the preview
# look (size, decoration, button places) is in menus.yml.
# Apply changes with /crate reload.
#
# Setting up (as op):
# /crate editor build and change crates with clicks
# /crate set <crate> look at a block (a chest, an ender chest...) to make it a crate
# /crate remove look at a crate block to make it normal again
# /crate give <player|all> <crate> [amount] [virtual|physical]
# /crate testroll <crate> 100000 check the real odds before players do
# Players: right-click a crate to open it, left-click to see what it can give,
# sneak + right-click to open many at once. /crates (or /keys) lists every crate.
# Language of the messages: en (messages.yml), es, pt, fr or de (lang/<code>.yml).
# Your own language: copy a file in the lang folder to lang/<code>.yml, translate it
# and set its code here (for example it for lang/it.yml).
language: en
# Replace messages.yml with the new design when the plugin is updated.
# Your old file is kept as messages.old-vX.yml. false = never touch it.
auto-update-style: true
storage:
# YAML = one file per player (one server).
# MYSQL = shared by every server of a network: a key won on the hub works on survival.
type: YAML
mysql:
host: localhost
port: 3306
database: minecraft
username: root
password: ''
parameters: useSSL=false&allowPublicKeyRetrieval=true&characterEncoding=utf8
table-prefix: jpcrates_
# How often keys given on other servers are picked up (seconds).
refresh-seconds: 10
# What /crate give hands out when you do not say: virtual (kept in /keys, never lost)
# or physical (an item in the inventory, can be traded).
default-key-type: virtual
# Do not open a crate while the inventory is full (rewards would drop on the floor).
require-empty-slot: true
# Push players back a little when they click a crate without a key. 0 = off.
no-key-knockback: 0.6
mass-open:
# Sneak + right-click opens many keys at once (Normal crates only).
enabled: true
# Keys used at most per mass open. A crate can change it with "mass-open: <n>".
max: 16
# Write every win to plugins/JPCrates/data/history.log (handy for support tickets).
history-log: true
# Rarities from common to rare. The order matters: pity gives "this rarity or better", and
# a Gamble crate upgrades to the next rarity in this list.
# broadcast: tell the whole server title: big text on screen firework / beam: effects
rarities:
common:
name: '&#B8B8B8Common'
color: '&#B8B8B8'
sound: ENTITY_EXPERIENCE_ORB_PICKUP
uncommon:
name: 'ED957Uncommon'
color: 'ED957'
sound: ENTITY_PLAYER_LEVELUP
rare:
name: 'FACFERare'
color: 'FACFE'
sound: ENTITY_PLAYER_LEVELUP
firework: true
firework-color: '#4FACFE'
epic:
name: '&#B06AB3&lEpic'
color: '&#B06AB3'
sound: UI_TOAST_CHALLENGE_COMPLETE
broadcast: true
title: true
firework: true
firework-color: '#B06AB3'
legendary:
name: '<gradient:#F7971E:#FFD200><bold>Legendary</bold></gradient>'
color: '&#FFD200'
sound: UI_TOAST_CHALLENGE_COMPLETE
broadcast: true
title: true
firework: true
beam: true
firework-color: '#FFD200'
hologram:
enabled: true
# Height of the text above the crate block.
height: 1.75
# The crate's key spins under the text.
spinning-key: true
# {name} {type} {opened} {last_winner} {last_reward}. Lines with the last winner are
# hidden until someone wins. A crate can use its own lines with "hologram-lines".
lines:
- '{name}'
- '&7Right-click to open &8· &7Left-click to preview'
- '&8Last win: &f{last_winner} &8» &r{last_reward}'
animations:
roll:
# How many times the items move before stopping (more = longer).
steps: 32
sound: BLOCK_NOTE_BLOCK_HAT
spin:
ticks: 60
show-ticks: 40
sound: BLOCK_NOTE_BLOCK_HAT
reveal-sound: ENTITY_EXPERIENCE_ORB_PICKUP
mystery:
card: ENDER_CHEST
bundle:
ticks-between: 5
sound: ENTITY_ITEM_PICKUP
sounds:
denied: ENTITY_VILLAGER_NO
select: UI_BUTTON_CLICK
reveal: BLOCK_ENDER_CHEST_OPEN
key: ENTITY_EXPERIENCE_ORB_PICKUP
mass-open: BLOCK_CHEST_OPEN
gamble-win: ENTITY_PLAYER_LEVELUP
gamble-lose: ENTITY_GENERIC_EXPLODESupport
Guides and the docs of every JP plugin are on the JP Plugins website. Questions, bugs or ideas? Join the JP Plugins Discord.
License
JPCrates is free to use on any server, including servers that make money, but it is not open source. Don't reupload, sell or share modified copies of it. The full terms are in LICENSE.txt, which is also inside the jar.