Crate Blocks
Place crates in the world, remove them, and set up their holograms and particle rings.
A crate block is any block in the world registered to a crate. Players right-click it to open a key and left-click it to preview the rewards. Placed blocks can have a hologram above them and particles around them, both set per crate.
Placing a crate
Section titled “Placing a crate”- Run
/cratesadmin place <crate>. You get the crate’sPlace-Item, tagged with the crate’s id. - Place it like any block. You get the
CRATE-PLACEDmessage and the block is registered at once.
The Place-Item must be a placeable block (a shulker box, chest, ender chest, beacon, and so on).
The tag is what makes it a crate, so the same item can be handed out, stored or copied; anyone who
places it registers a crate block.
If a protection plugin cancels the placement, nothing is registered.
Interacting
Section titled “Interacting”| Action | Result |
|---|---|
| Right click | Opens one key. With no key, sends INSUFFICIENT-KEYS, plays the DENIED sound and, when Knockback-Keyless-Players is on, pushes the player back. |
| Left click | Opens the reward preview (if the crate has its preview enabled). |
| Sneak + left click | With optimalcrates.admin: removes the crate block and sends CRATE-BROKEN. |
A PICK crate opens its picker on right click, since picking is how its keys are spent.
Protection
Section titled “Protection”Registered crate blocks cannot be broken, not even by admins in creative. They are removed from
explosions (TNT, creepers, beds and so on) and pistons cannot push or pull them. The only way to
remove one is sneak + left click with optimalcrates.admin, which also sets the block to air.
Hologram
Section titled “Hologram”Add a Hologram section to the crate file:
Hologram: Enabled: true Height: 2.9 Update-Interval: 50 Lines: - "&a&lVote Crate" - "&7You have &f{keys}x &7crate keys." - "&e➥ Left click to preview!" - "&e➥ Right click to open!" - "" - "{item-display}"Heightis how far above the bottom of the block the hologram sits, in blocks.- Every
Update-Intervalticks the hologram moves on to the next reward in the crate, so{item-display},{reward}and{chance}cycle through the whole reward list. {keys}shows each viewer their own key balance, and%...%placeholders are resolved per viewer.- The hologram is sent as packets to players within 48 blocks, so it is not a real entity and cannot be broken or left behind.
Full field list: crates reference.
Particles
Section titled “Particles”Add a Particles section to the crate file:
Particles: Enabled: true Interval: 2 Particle: "Dust" Color: "#00FF00"Particle: "Dust" draws two counter-rotating rings of dust around the block. Color is one hex
color, or several separated by commas for a smooth color cycle:
Color: "#FF5555,#FFAA00,#55FF55,#55FFFF,#5555FF"Any other particle name is spawned as a simple burst above the block. You can add the offsets, speed
and count after it, separated by ;:
Particle: "FLAME;0.4;0.5;0.4;0;6"Particles are only sent to players within about 34 blocks who can see the block, so idle crates in unloaded or empty areas cost nothing.
Full field list: crates reference.
Editing from the game
Section titled “Editing from the game”The In-Game Editor has a Particles and a Hologram menu for every crate, with toggles and chat prompts for every field. Changes apply to placed blocks immediately.
