Glass plugin suite wiki by GlassMC and GlassHosting. Licensing and downloads are coming soon through GlassBilling.

GlassAPI

Version 2.3.0-alpha.3 • Tested on Paper 26.3, Velocity 4.2 • Java 25 • Always free • Support: support@glasshosting.com

Overview

GlassAPI is the shared foundation for the Glass suite. It gives other plugins:

  • Persistent item and reward identifiers and ownership records, with compare-and-set transfers.
  • A namespaced document store with revisions, integrity checks and atomic file writes (GlassNPC, GlassPerms and GlassRewards keep their data here).
  • Setup drafts: native in-game dialogs for configuring registered plugins, with preview, apply, rollback and recovery.
  • An optional network mode that shares documents across Paper backends and a Velocity proxy through MariaDB.
  • Shared branding and edition helpers.

You install it once; players never interact with it directly. It replaces the older CoreDataAPI plugin and keeps its commands, permissions and item keys working.

Requirements

  • Paper 26.3 (tested on build 200) or Velocity 4.2.
  • Java 25.
  • No other plugins required. MariaDB only if you enable network mode.

Installation

  1. Stop the server. Back up plugins/, world and player data.
  2. Put one GlassAPI JAR in plugins/. Do not install CoreDataAPI alongside it, and do not install free and paid editions together.
  3. Start the server. New installs create plugins/GlassAPI/ with protection.mode: 'OFF'.
  4. Run /glassapi status and /glassapi integrity.

Upgrading from CoreDataAPI: leave plugins/CoreDataAPI/ in place. If plugins/GlassAPI/ is missing or empty, GlassAPI copies the legacy folder once and writes migration-from-CoreDataAPI.txt so it never copies again. If both folders already hold data, startup stops so you can reconcile them by hand. Imported configs without a protection setting keep BLOCK behavior.

First-time setup

  1. Keep the generated encryptionKey and back it up with ownership.yml. Never rotate it in place.
  2. Decide on protection.mode. Leave it 'OFF' if you run NoDupe (GlassGuard), which owns anti-duplication.
  3. Single server: leave network.properties at enabled=false.
  4. Players with GlassPerms, GlassNPC or GlassRewards: just install those; they find GlassAPI automatically.

Commands

Aliases: /gapi, /cda.

Command Permission What it does
/glassapi glassapi.admin or coredatapapi.admin Show the command list.
/glassapi setup glassapi.setup Open the setup dashboard (in game) with a button per registered plugin and your drafts.
/glassapi setup new <provider> glassapi.setup Create a setup draft for a registered provider.
/glassapi setup list glassapi.setup List your drafts.
/glassapi setup open <id> glassapi.setup Open a draft in the dialog editor.
/glassapi setup set <id> <revision> <key> <value> glassapi.setup Change one setting in a draft.
/glassapi setup preview <id> glassapi.setup Show changes, blocking issues and whether a restart is needed.
/glassapi setup apply <id> <revision> glassapi.setup Apply a previewed draft.
/glassapi setup rollback <id> <revision> glassapi.setup Roll back an applied draft.
/glassapi setup recover <id> <revision> glassapi.setup (glassapi.setup.recover for other admins' drafts) Recover an interrupted apply.
/glassapi diagnostics glassapi.diagnostics Version, contracts, storage, protection, queued and failed writes, registered capabilities.
/glassapi check <itemId> glassapi.admin Show the owner UUID of an item.
/glassapi revoke <itemId> glassapi.admin Remove an item's ownership record (audited).
/glassapi status glassapi.admin Storage available, read-only mode, record count, protection mode, dropped audit/webhook entries. On Velocity: connection and peer status.
/glassapi integrity glassapi.admin Full integrity scan of ownership records.
/glassapi audit [INFO|WARN|ERROR] glassapi.admin Last 20 audit log lines.
/glassapi reload glassapi.admin Reload roles, webhooks and protection. Refuses encryption key changes.
/glassapi refresh (Velocity) glassapi.admin Retry network discovery.

Permissions

Node Default Grants
glassapi.admin op All admin commands; children: coredatapapi.admin, glassapi.setup, glassapi.setup.protection, glassapi.setup.branding, glassapi.setup.recover, glassapi.diagnostics
glassapi.setup op Create and edit your own setup drafts
glassapi.setup.protection op Change legacy protection policy through setup
glassapi.setup.branding op Change edition-permitted branding
glassapi.setup.recover op Inspect other admins' drafts; recover or restore settings
glassapi.diagnostics op View redacted health and capabilities
coredatapapi.admin op Legacy admin node
coredatapapi.bypass false Bypass ownership enforcement (admin tools)
coredatapapi.read false Read-only ownership access
coredatapapi.modify false Modify ownership records
coredatapapi.delete false Delete ownership records
coredatapapi.role.reader false Reader role
coredatapapi.role.editor false Editor role
coredatapapi.role.admin op Admin role

Configuration

config.yml

Key Default Effect
encryptionKey change_me_16_chars (a real key is generated on a new, empty install) Encrypts and signs ownership data. A missing or wrong key with existing data stops startup without touching data. Never rotate in place.
protection.mode 'OFF' OFF: API only. MONITOR: record legacy ownership observations without blocking. BLOCK: legacy owner pickup/drop/shift-click/hopper restrictions.
encryptWebhooks false Encrypt HTTPS webhook payloads. Restart after changing.
branding.show-credit true Paid editions may hide startup credits.

roles.yml

Defines reader (read), editor (read, modify) and admin (read, modify, delete) with read, modify, delete booleans.

webhooks.yml

Lists of HTTPS endpoints under webhooks.ownershipChange, webhooks.itemInspection, webhooks.suspiciousActivity. All empty by default; nothing is contacted unless you add an endpoint.

network.properties

Key Default Effect
enabled false Turn on shared network services. Restart required.
network-id glassmc Same on every instance of one network.
node-id change-me Unique on every backend and proxy (lowercase, digits, _, -, max 40). Must be changed before enabling.
jdbc-url jdbc:mariadb://127.0.0.1:3306/glassapi?connectTimeout=5000&socketTimeout=15000 MariaDB JDBC URL. Add &sslMode=verify-full for TLS.
username glassapi Database user.
password empty Password, or env:GLASS_NETWORK_PASSWORD to read an environment variable.

Using it efficiently

  • Single server: install, check /glassapi status, then forget it. Leave network mode off.
  • Network setup: create one MariaDB schema and an account with CREATE, SELECT, INSERT, UPDATE and DELETE on that schema only. GlassAPI creates glassapi_documents, glassapi_locks and glassapi_nodes. Use the same network-id and database everywhere, a different node-id on each server (for example lobby, survival, velocity-1), and put the password in an environment variable.
  • Do not turn network mode off as an outage workaround. That switches to the old local data, not the latest shared data. On a database outage, shared writes stop; they resume when the database returns.
  • After a crash with the same node-id, allow up to 90 seconds before that node is accepted again.
  • Protection: if you use NoDupe, keep OFF (or MONITOR to observe). Do not run overlapping rules.
  • Backups: stop the server and back up plugins/GlassAPI/ (key and data together), plus the shared database in network mode.

Integration with other Glass plugins

GlassPerms, GlassNPC and GlassRewards declare depend: [GlassAPI] and store their documents in GlassAPI namespaces. GlassPerms is the first consumer of network mode (shared rank rules, receipts and vote totals). Existing NPC and reward data is not moved into network storage automatically.

For developers: depend on net.glassmc:glassapi as provided, declare depend: [GlassAPI], and load GlassAPI or GlassCore from Bukkit's ServicesManager. Do not shade GlassAPI into your plugin.

Troubleshooting

Problem Fix
Startup stops with a key or integrity error Restore the matching ownership.yml and original encryptionKey from the same backup. GlassAPI never replaces data or keys.
Startup stops: both CoreDataAPI and GlassAPI folders hold data Inspect offline, decide which is authoritative, then keep only that one.
Reload rejected Fix YAML or protection.mode; keep the original encryption key.
Network node rejected after a crash Wait up to 90 seconds or confirm no other instance uses that node-id.
A dependent plugin says GlassAPI is too old Install the newer GlassAPI; older plugins keep working with newer GlassAPI.

Not supported: Folia, /reload hot reload, two GlassAPI JARs.

Changelog

  • 2.3.0-alpha.3: Paper 26.3 support (tested on 26.3 build 200), plain punctuation, Glass Software License notices.
  • 2.3.0-alpha.2: Velocity and network services with shared shard branding.
  • 2.3.0-alpha.1: Native Velocity entry point, optional MariaDB network documents.
  • 2.2: Setup editor (/glassapi setup), diagnostics, scoped setup permissions.
  • 2.0: Renamed from CoreDataAPI with non-destructive folder import and legacy aliases.