Skip to content

PermissionDefault

Namespace Mc.Scripting.Permissions · Kind struct (readonly)

public readonly struct PermissionDefault : IEquatable<PermissionDefault>

What a permission node is worth when no group or player entry decides it.

Member Description
static PermissionDefault False { get; } Nobody has it (until granted).
static PermissionDefault NotOp { get; } Everybody who is not an operator (level below 2).
static PermissionDefault Op { get; } Operators of vanilla permission level 2 and up (the “gamemaster” level: command blocks and most admin commands).
static PermissionDefault True { get; } Everybody has it.
public static PermissionDefault False { get; }

Nobody has it (until granted).

public static PermissionDefault NotOp { get; }

Everybody who is not an operator (level below 2).

public static PermissionDefault Op { get; }

Operators of vanilla permission level 2 and up (the “gamemaster” level: command blocks and most admin commands).

public static PermissionDefault True { get; }

Everybody has it.

Member Description
bool Evaluate(int permissionLevel) Evaluates the default for a player of the given vanilla permission level.
override string ToString() The name used in plugin.json and permissions.json: “true”, “false”, “op”, “op:3”, “not_op”.
static PermissionDefault OpLevel(int level) Operators of at least vanilla level level (1 = bypass spawn protection, 2 = gamemaster, 3 = admin, 4 = owner).
static bool TryParse(string? text, out PermissionDefault value) Parses the text form (see PermissionDefault.ToString).
public bool Evaluate(int permissionLevel)

Evaluates the default for a player of the given vanilla permission level.

Parameters

Name Type Description
permissionLevel int The player’s operator level (0 for non-operators).

Returns bool: Whether the player has the permission by default.

public override string ToString()

The name used in plugin.json and permissions.json: “true”, “false”, “op”, “op:3”, “not_op”.

Returns string

public static PermissionDefault OpLevel(int level)

Operators of at least vanilla level level (1 = bypass spawn protection, 2 = gamemaster, 3 = admin, 4 = owner).

Parameters

Name Type Description
level int The minimum permission level, 0-4.

Returns PermissionDefault

public static bool TryParse(string? text, out PermissionDefault value)

Parses the text form (see PermissionDefault.ToString).

Parameters

Name Type Description
text string? The text.
value out PermissionDefault The result.

Returns bool: Whether the text was valid.