MCPass
A cross-platform pass system for Minecraft. Passes are activated with a Player Head, only one is active at a time, and every pass is bound to the player's active identity through MCIdentity.
Player Head activation
A pass is activated with a specific in-game item — a
Player Head tagged in its persistent data container
with the mcpass_id it activates and an
account_type. Right-clicking the head activates that pass
for the player's active identity when the account type is
identity. Admins hand these out with
/mcpass give <passId> [player], and a player can grab
their own with /mcpass get <passId>.
Activation reads only the persistent data container — never the item's name or lore, which players can rename or relore freely — so the head is self-describing and survives being dropped, stored, renamed, or traded.
One active pass
A player may own many passes at once, but only one is active. Activating a pass — done only by right-clicking its Player Head — creates it if needed, makes it active, and deactivates every other pass the identity owns, all in one atomic operation.
Identity binding
Every pass row is keyed by the active identity UUID,
resolved through MCIdentityProvider.getActiveIdentity(playerUuid)
— never the player's base UUID. Each identity a player owns therefore
keeps its own independent passes, points, and progress.
Never key pass data by the player UUID. Doing so would collapse a player's distinct characters into one shared pass.
In-game editor
Operators design a pass's items in-game with
/mcpass editor (permission mcpass.editor, op by
default), so passes are defined in the database rather than a config file.
The editor has two tiers:
A read-only, paginated list of every pass, titled
Pass Editor - Page {n}. Click a pass to edit it, or create
one with /mcpass create <passId> or
/mcpass editor <passId> (creating a new pass id needs
mcpass.create).
A six-row menu titled Pass {Id} Editor - Page {n} whose
top five rows are a freely editable canvas and whose bottom row holds
an in-memory countdown (slot 45), Save (slot 46), and the
centered Previous (slot 48), Set Custom Head (slot 49), and
Next (slot 50) controls. The page number is in the title, not an
item.
Items keep their exact slot when saved, so custom layouts are preserved, and a pass can hold several pages of items. Empty slots show a tooltip-less black stained glass filler that is stripped on save. Save writes the current page to the database as Base64 and immediately re-opens it, so what you see always matches what is stored. The Previous and Next arrows appear only when there is a page to turn to.
Set Custom Head (slot 49) copies
the texture of a player head you are holding onto the pass, so it renders
with that head in every menu — the in-game equivalent of
/mcpass texture, with no Base64 string to paste. Creating a
brand-new pass id is gated behind its own mcpass.create
permission, so editing existing passes and defining new ones can be granted
separately.
The editor is intended for operators, typically in creative mode. Placing an item consumes it into the layout, like a kit editor — close the menu with Save to keep your changes.
Bounded memory. The editor loads
only the page you open, never every page of every pass. A loaded page stays
in memory while anyone is viewing it and for
GUI.in_memory_count_down minutes (default 5) after the last
viewer leaves; reopening the page resets that countdown, which the clock at
slot 45 shows.
See the 0.4.0 change log for the full list of activation, command, and editor changes.
Storage backends
Choose a backend with database.type in config.yml.
Every backend implements the same IMCPassDB contract.
| Backend | database.type | Notes |
|---|---|---|
| SQLite | sqlite | Default, zero-config local file. |
| MySQL / MariaDB | mysql | For an existing MySQL-compatible server. |
| PostgreSQL | postgresql | Downloaded driver at runtime. |
| MongoDB | mongodb | Document-oriented storage. |
| Central server | central | Shared REST server across a network. |
Commands
| Command | Description | Permission |
|---|---|---|
/mcpass gui | Open the Available menu (the Unavailable menu is reached from a button inside it). | — |
/mcpass get <passId> | Get your own activation item for an existing pass, to right-click and activate it. | — |
/mcpass list | List your active identity's passes. | — |
/mcpass active | Show your active pass and points. | — |
/mcpass create <passId> [headTexture] | Create a pass definition. The head texture is optional; omit it for the default plain head. | mcpass.create |
/mcpass editor [passId] | Open the pass item editor (selection menu, or a pass directly). Naming a pass that does not exist creates it. | mcpass.editor; new pass id also needs mcpass.create |
/mcpass give <passId> [player] | Give a pass activation head. | mcpass.admin |
/mcpass texture <passId> <base64> | Set a pass's head texture. | mcpass.admin |
Database schema
Pass data spans three tables (or their document equivalents): ownership, pass definitions, and editor item pages.
The mcpass_accounts table (ownership)
Ownership rows (formerly the mcpass table). The
account_type and account_uuid columns
generalize ownership beyond a single identity; MCPass always writes
account_type = "identity" with the active identity UUID.
| Column | Type | Purpose |
|---|---|---|
id | BIGINT AUTO_INCREMENT PK | Row id. |
identity_uuid | VARCHAR(36) NOT NULL | Owning identity UUID. |
mcpass_id | VARCHAR(255) NOT NULL | Pass definition code. |
account_type | VARCHAR(64) NOT NULL DEFAULT 'identity' | Account kind (identity, world, guild, clan…). |
account_uuid | VARCHAR(36) | Account UUID; equals the identity for identity accounts. |
is_active | BOOLEAN NOT NULL DEFAULT FALSE | The active pass. |
points | INT NOT NULL DEFAULT 0 | Progress points. |
time_end | TIMESTAMP NULL | Expiry, or null. |
created_at | TIMESTAMP | Creation time. |
updated_at | TIMESTAMP | Last update time. |
The mcpass_id table (pass definitions)
One row per pass, holding the head texture shown in the menus (the Base64 value that replaced the old config section).
| Column | Type | Purpose |
|---|---|---|
id | VARCHAR(255) PRIMARY KEY | Pass id (its name). |
head_texture | TEXT NOT NULL | Base64 head texture; blank for a plain head. |
created_at | TIMESTAMP | Creation time. |
updated_at | TIMESTAMP | Last update time. |
The mcpass_items table (editor item pages)
The item layouts built in the editor, one row per page, so a pass can
hold several pages. contents is the Base64 serialization
of the page's canvas, preserving each item's slot.
| Column | Type | Purpose |
|---|---|---|
pass_id | VARCHAR(255) NOT NULL → mcpass_id(id) | Owning pass. |
index | INT NOT NULL DEFAULT 1 | One-based page index (quoted, a reserved word). |
contents | TEXT | Base64 item layout for the page. |
created_at | TIMESTAMP | Creation time. |
updated_at | TIMESTAMP | Last update time. |
Developer API
Resolve the active identity through MCIdentity, then key everything by that identity UUID:
Javaimport io.github.mcoriax.mcidentity.common.MCIdentityProvider;
import io.github.mcbelith.mcpass.common.MCPassProvider;
if (!MCIdentityProvider.hasDatabase() || !MCPassProvider.hasDatabase()) return;
UUID playerUuid = player.getUniqueId();
MCIdentityProvider.instance.getActiveIdentity(playerUuid).thenAccept(opt -> {
if (opt.isEmpty()) return; // no identity → hold, never use player UUID
UUID identityUuid = opt.get();
MCPassProvider.instance.setActivePass(identityUuid, "season1");
MCPassProvider.instance.addPoints(identityUuid, "season1", 25);
});
Full reference: see wiki/api.md in the
mcpass repository.
Modules
MCPass is built from these modules. Each page says what the module holds and, for a published one, how to depend on it.