/minestom-knowledge:luckpermsfrom Minestom Knowledge
How to embed LuckPerms in a Minestom project the way OneLiteFeather does it — bootstrapping the `net.luckperms:minestom-loader` JarInJar loader yourself in main() (Minestom has no plugin folder to drop a jar into), the Adventure-version exclude every LuckPerms dependency needs, the hardcoded `data/` runtime directory LuckPerms creates next to the process (config.yml, its H2 database, downloaded translation bundles, and a self-relocated `libs/` cache), the test-classpath Gson conflict its loader causes, and how to bridge LuckPerms permission checks across a classloader boundary (e.g. into a CloudNet bridge extension — see the `cloudnet` skill). Use this whenever adding LuckPerms to a Minestom project, wiring up permission checks, debugging why a `data/` folder full of jars and a database appeared next to the server, or a LuckPerms-loaded test run breaks with a Gson/registry error — generic LuckPerms docs (written for Bukkit/Velocity/Sponge, which auto-load plugins from a folder) won't cover any of this, since Minestom has no plugin loader for LuckPerms to hook into.
Trending skills
7-day visitors to each skill page
Ships in Minestom Knowledge. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
LuckPerms has no Bukkit/Velocity-style plugin folder to drop a jar into on Minestom — there's no plugin loader
scanning a directory at startup. Instead, net.luckperms:minestom-loader is a small JarInJar loader library:
you depend on it directly, and your own main() bootstraps it. Everything below follows from that one
difference.
Add minestom-loader as both runtimeOnly (it's what actually runs) and compileOnly (your code calls
MinestomLoader.get() directly, so it needs to be on the compile classpath too), plus net.luckperms:api to
interact with LuckPerms once it's running:
dependencies {
compileOnly(libs.luckperms.api) {
exclude(group = "net.kyori.adventure")
}
runtimeOnly(libs.luckperms.minestom.loader) {
exclude(group = "net.kyori.adventure")
}
compileOnly(libs.luckperms.minestom.loader) {
exclude(group = "net.kyori.adventure")
}
}
Then, as early as possible in main() — before anything that might need a permission check — bootstrap it:
me.lucko.luckperms.minestom.loader.MinestomLoader.get().load().registerShutdownHook().start();
.load() extracts LuckPerms' actual bootstrap class from an embedded luckperms-minestom.jarinjar via an
isolated JarInJarClassLoader and instantiates it; .registerShutdownHook() wires clean shutdown into the JVM;
.start() brings LuckPerms up and returns once it's ready — LuckPermsProvider.get() is safe to call only after
this returns.
Don't try to load LuckPerms as a Minestom extension instead. The minestom-loader jar does ship its own
extension.json (pointing at me.lucko.luckperms.minestom.loader.MinestomLoaderExtension), but that class isn't
actually present in the artifact as of 5.6-SNAPSHOT — dropping the jar into extensions/ and expecting the
ExtensionBootstrap (see the cloudnet skill) to pick it up won't work. Programmatic bootstrap in main() is the
supported path.
data/ directory LuckPerms createsLuckPerms' Minestom bootstrap resolves its data directory as Paths.get("data").toAbsolutePath() —
hardcoded, not configurable through any loader API. Whatever the process's working directory is when you run
it, a data/ folder appears next to it on first boot, containing:
config.yml — LuckPerms' own config, auto-extracted with its normal defaults (storage-method: h2 unless
changed).luckperms-h2-v2.mv.db) — the default storage backend.translations/ — downloaded translation bundles, if auto-install-translations: true (the default).libs/ — LuckPerms downloads its own runtime dependencies (ASM, ByteBuddy, Caffeine, Configurate,
the event bus lib, an H2 driver, jar-relocator, OkHttp/Okio, SnakeYAML) and relocates them with
ByteBuddy + ASM + jar-relocator on first boot, caching the relocated jars here so it doesn't repeat the work
on later boots.Two practical consequences:
data/ — it's entirely runtime-generated. Make sure it's gitignored; if you find it already
checked in, that's a mistake to fix, not a template to copy from.libs/ dependencies. If a service
deploys into an offline/sandboxed environment (a locked-down CloudNet node, an air-gapped CI job), either ensure
egress to fetch them or pre-seed data/libs (copied from a normal dev boot) into the deployment template so
first boot doesn't need the network.LuckPerms bundles its own version of Adventure internally. A Minestom project already has Adventure on the
classpath — directly, or transitively through Aves — so every luckperms.* dependency declaration needs
exclude(group = "net.kyori.adventure"), on api and minestom-loader alike (see the block above). Skipping
this on either one leaves two competing Adventure versions on the classpath, which surfaces as Component
serialization or method-resolution errors that don't obviously point back to LuckPerms.
LuckPerms expects an unrelocated Guava on the classpath. If nothing else in the project provides one (it used
to arrive transitively through CloudNet — no longer true once CloudNet is compileOnly, see the cloudnet
skill), declare it explicitly:
implementation(libs.guava)
minestom-loader's JarInJar bundle ships an unrelocated, outdated Gson. Tests don't bootstrap LuckPerms at
all, but as a runtimeOnly dependency the loader still leaks onto the test runtime classpath, where its bundled
Gson shadows the project's real one and breaks Minestom's own registry init —
GsonBuilder.disableJdkUnsafe NoSuchMethodError is the telltale symptom. Exclude it from the test runtime
classpath specifically (compile-time visibility for any LuckPerms-aware test code is unaffected):
configurations.testRuntimeClasspath {
exclude(group = "net.luckperms", module = "minestom-loader")
}
After .start() returns, LuckPermsProvider.get() gives you the live LuckPerms API instance:
User user = LuckPermsProvider.get().getUserManager().getUser(playerId);
boolean allowed = user != null
&& user.getCachedData().getPermissionData().checkPermission(permission).asBoolean();
Guard against user == null — a player LuckPerms hasn't loaded/cached yet (very early in connection handling)
looks like "no permissions" rather than throwing, so treat null as false, not as an error.
LuckPerms lives in the application's own classloader realm (loaded via the JarInJar bootstrap above). If something
elsewhere needs to check a LuckPerms permission but runs in a different classloader — most commonly a CloudNet
bridge extension loaded through ExtensionBootstrap (see the cloudnet skill) — it cannot reference LuckPerms
classes directly; the two realms only share whatever loaded the fat jar itself.
The fix is a small holder class in a module both sides can see, exchanging only JDK types:
// in a shared "common" module — no LuckPerms or CloudNet types here
public final class PermissionBridge {
private static volatile BiPredicate<UUID, String> resolver;
public static void setResolver(BiPredicate<UUID, String> permissionResolver) {
resolver = permissionResolver;
}
public static boolean hasPermission(UUID playerId, String permission) {
BiPredicate<UUID, String> current = resolver;
return current != null && current.test(playerId, permission);
}
}
The application installs the LuckPerms-backed resolver right after .start() returns:
PermissionBridge.setResolver((playerId, permission) -> {
User user = LuckPermsProvider.get().getUserManager().getUser(playerId);
return user != null && user.getCachedData().getPermissionData().checkPermission(permission).asBoolean();
});
...and the extension living in the other classloader (e.g. implementing CloudNet's MinestomPermissionChecker)
just calls PermissionBridge.hasPermission(player.getUuid(), permission) — it never references
net.luckperms.* directly, so it doesn't matter that it can't see that classloader realm. The resolver returns
false before the application has called setResolver (early startup), which is the correct "no permission yet"
default rather than throwing.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub onelitefeathernet/onelitefeather-claude-marketplace --plugin minestom-knowledge10 skills in this plugin
/avesHow to use Aves, OneLiteFeather's general utility library for Minestom servers (github.com/OneLiteFeatherNET/Aves) — GUI inventories, file persistence, i18n/translated text and items, maps, resource packs, and misc utilities (items, vectors, probability collections). Use this whenever building a GUI/menu, persisting data to JSON, sending translated messages or items, defining a game map, handling resource pack delivery, or reaching for a small utility (item counting, weighted random pick, vector math) in a OneLiteFeather Minestom project — Aves is internal-only and covers ground that would otherwise be reinvented per project./bomsOneLiteFeather's tiered Bill-of-Materials (BOM) hierarchy for dependency version management — mycelium-bom, aonyx-bom, and manis-bom, which one a project should import as its dependency platform, and how to add a new managed dependency to one. Use this whenever a Minestom/OneLiteFeather project needs a new dependency added, when choosing which BOM to import in a new project's build.gradle.kts, or when a dependency version needs bumping across the org rather than in one project. Complements the `gradle` skill, which covers how a BOM plugs into a build file in general — this one covers which BOM to use and what's actually inside each./cloudnetHow to get a OneLiteFeather Minestom project running as a CloudNet service out of the box — reading CloudNet's injected bind host/port and stop signal, loading the CloudNet_Bridge through the minestom-ce-extensions ExtensionBootstrap (Minestom has no built-in extension system anymore), writing a bridge/permission extension.json that talks to CloudNet's driver/bridge APIs, and the Gradle dependency + maven-publish setup (shadowJar as the published artifact, compileOnly for everything CloudNet, the cloudnet-bom version catalog entries) so the build produces something CloudNet can actually run. Use this whenever setting up a new Minestom service/lobby/minigame project for CloudNet deployment, writing or editing an extension.json, debugging why a service won't bind or won't stop cleanly under CloudNet, or wiring CloudNet driver/bridge dependencies into build.gradle.kts — generic CloudNet or Minestom knowledge alone will miss that Minestom dropped its own extension system (this org depends on the minestom-ce-extensions fork instead) and that CloudNet jars must stay compileOnly, never bundled./corisHow to use Coris, OneLiteFeather's management API for floors, rooms, doors, and shapes on Minestom (github.com/OneLiteFeatherNET/Coris) — defining room/floor structures with Shape-based areas, registries, doors with open/lock behavior, and the associated events. Use this whenever modeling spatial structure on a Minestom server at OneLiteFeather — dungeon floors and rooms, area-based triggers, or interactive doors — instead of hand-rolling bounding-box/region logic. Coris is marked experimental (@ApiStatus.Experimental on its core interfaces) — mention that to the user if API stability matters for their use case./cyanoHow to write and structure tests for Minestom-based projects using Cyano, OneLiteFeather's internal JUnit5 testing extension for Minestom (github.com/OneLiteFeatherNET/Cyano). Use this whenever writing, reviewing, or debugging a test that touches Minestom — creating players/instances in a test, asserting on packets sent to a client, or setting up a JUnit test class for a Minestom server/game project. Cyano is internal and niche enough that general Minestom or JUnit knowledge alone will get the details wrong (extension class, player/instance lifecycle, cleanup order) — always check this skill before writing Minestom test code, even if you're confident you already know JUnit5./gradleOneLiteFeather's Gradle (Kotlin DSL) conventions for Minestom projects — how build.gradle.kts and settings.gradle.kts should look, single-module libraries vs multi-module applications, the private Maven repo, and Java toolchain settings. Use this whenever creating or editing a build.gradle.kts, settings.gradle.kts, or buildSrc convention plugin in a OneLiteFeather/Minestom project — generic Gradle knowledge alone will miss team-specific details (inline version catalog instead of libs.versions.toml, the private repo credential split, the -Dminestom.inside-test=true test flag) and produce a build file that looks plausible but doesn't match the rest of the team's projects.Other plugins' skills for the same job