Skip to main content
Version: Minecraft 26.2

dev.polymodloader.api.permission

Generated

This page is generated from the source's Javadoc by ./gradlew apiReference. Do not edit it; fix the source comment and generate it again.

TypeKindDescription
PermissionNoderecordA named permission, <mod id>.<path>.
PermissionProviderfunctional interfaceDecides permissions, for example from a permissions file or groups.
PermissionRegistrarinterfaceDeclares a mod's permissions and lets permission mods decide them.
PermissionResultenumWhat a PermissionProvider decided.

PermissionNode​

record · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier

public record PermissionNode(String id, int defaultLevel)

A named permission, <mod id>.<path>. Permission providers (a permissions mod) decide it per player; without a decision, players need the default operator level.

ComponentTypeDescription
idStringdotted name, for example my_mod.teleport.others
defaultLevelintoperator level needed when no provider decides: 0 everyone, 2 game masters, 4 server owners

PermissionProvider​

functional interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier

public interface PermissionProvider

Decides permissions, for example from a permissions file or groups. Providers are asked in registration order; the first answer other than PermissionResult.UNDECIDED counts. Called on the server thread, often (command suggestions); keep it fast.

check(PlayerView, PermissionNode)​

PermissionResult check(PlayerView player, PermissionNode node)

Since 0.1.0-alpha.4 or earlier

Whether player has node, or PermissionResult.UNDECIDED to let the next provider or the node's default decide.

ParameterTypeDescription
playerPlayerView—
nodePermissionNode—

Returns PermissionResult

PermissionRegistrar​

interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier

public interface PermissionRegistrar

Declares a mod's permissions and lets permission mods decide them.

node(String, int)​

PermissionNode node(String path, int defaultLevel)

Since 0.1.0-alpha.4 or earlier

Declares <mod id>.<path>.

ParameterTypeDescription
pathStringdotted, a-z 0-9 _ .
defaultLevelint—

Returns PermissionNode

Throws IllegalArgumentException — for an invalid or used path (POLY-PERMISSION-001)

provider(PermissionProvider)​

void provider(PermissionProvider provider)

Since 0.1.0-alpha.4 or earlier

Adds a provider asked for every permission check of every mod.

ParameterTypeDescription
providerPermissionProvider—

PermissionResult​

enum · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier

public enum PermissionResult

What a PermissionProvider decided.

ConstantDescription
ALLOW—
DENY—
UNDECIDEDNo opinion; the next provider, or the node's default level, decides.
Buy me a coffee