メインコンテンツまでスキップ

Crate

The Crate Extension provides virtual loot crates for the official Typewriter runtime: weighted rewards, virtual keys, milestones, OmniGUI menus and visual opening sequences. Physical world-crates and physical key adapters are reserved for the custom BTC profile and are not part of this public artifact.

Compatibility profiles

The public extension targets the official Typewriter runtime on Paper/ASPaper 1.21.x and emits JVM 21 bytecode so it remains usable on official 1.21 servers. It uses the official OmniGUI dependency (renaud:GuiAndDialogs) for menus.

The custom BTC profile is a separate adapter layer. It may target BTC Core, BTC Velocity, Folia and Java 25, but those dependencies and scheduler assumptions must not be introduced into this public artifact.

Opening mini-games

Crates can open through a world-space mini-game instead of a plain animation. The reward is drawn server-side before the mini-game starts; the game is pure presentation and grants the already-decided reward exactly once.

  • Cards — A grid of face-down cards; the selected card reveals the reward and the rest reveal decoys.

Architecture

Entry library

Definitions

Actions

Artifacts

Quick start

  1. Define a crate and, if needed, a crate_main_menu entry.
  2. Create a crate_artifact and reference it from the crate.
  3. Configure rewards, rarity weights, reward slots and optional milestones.
  4. Trigger open_crate or open_crate_menu from Typewriter.

Commands

All commands are under /crate:

CommandDescriptionPermission
/crate menuOpen the global crate menutypewriter.crate.menu
/crate give <crate_id> [amount]Grant virtual keystypewriter.crate.give
/crate remove <crate_id> [amount]Revoke virtual keystypewriter.crate.remove

Placeholders

Both %crate_<crate_id>_<field>% and %typewriter_crate_<crate_id>_<field>% are accepted.

FieldDescription
openingsTotal openings by the player
keysVirtual keys held
keys_usedKeys consumed
last_openLast opening timestamp
milestoneHighest reached milestone

Unknown crates and fields return null, allowing Typewriter's placeholder fallback to apply.

Permissions

PermissionDescription
typewriter.crateBase access to crate commands
typewriter.crate.menuOpen the crate menu
typewriter.crate.giveGive virtual keys
typewriter.crate.removeRemove virtual keys

Dependencies

ExtensionRequiredUsage
Typewriter BasicRequiredTypewriter runtime and entries
OmniGUI / GuiAndDialogsRequiredMenu rendering and layout system
PlaceholderAPIOptionalPlaceholder parsing where installed