Project Essentials Permissions

Documentation for Project Essentials Permissions users and developers, describing commands, permissions and API methods and other.

This modification serves as a command permissions provider for players. It is very suitable for delimiting the permissions of players and limiting the player's capabilities, for example, to prohibit changing the weather or to allow repair items. If you ever used PermissionsEx for spigot, then you will not have problems with setting permissions. Also, the mod has its own API, to use it, start by reading the documentation.

How to Install

For start the modification, you need installed Forge, it is desirable that the version matches the supported versions. You can download Forge 1.14.4 from the link and Forge 1.15.2 from it link. Move the downloaded mod to the mods folder (installation example below).

val MV = valueOf(your_minecraft_version)

.
โ”œโ”€โ”€ assets
โ”œโ”€โ”€ config
โ”œโ”€โ”€ libraries
โ”œโ”€โ”€ mods (that's how it should be)
โ”‚   โ”œโ”€โ”€ Project Essentials Core-MOD-1.MV.X-1.X.X.jar (mandatory)
โ”‚   โ”œโ”€โ”€ Project Essentials Cooldown-1.MV.X-1.X.X.jar (recommended)
โ”‚   โ””โ”€โ”€ Project Essentials Permissions-1.MV.X-1.X.X.jar
โ””โ”€โ”€ ...

Dependencies

Also do not forget to install dependencies, only two types of dependencies: mandatory (game will not start without a mod) and recommended (without a mod, game can start, but I recommend using it).

Download dependencies: Cooldown ยท Core

One more step

Now try to start the game, go to the mods tab, if this modification is displayed in the mods tab, then the mod has been successfully installed.

Commands and Permissions

Name

Usage Example

Permission

Description

/permissions about

-

ess.perm.about

Just send you about message.

/permissions save

-

ess.perm.save

Save permissions configuration.

/permissions reload

-

ess.perm.reload

Reload permissions configuration without saving.

/permissions group

... [group name] [set | remove] [node]

ess.perm.group

Remove or set permission for the target group.

/permissions user

... [user name] [set | remove] [node] or [user name] set [group name]

ess.perm.user

Remove or set user permission node or only set group for the user.

Configuration

Configuration location

.minecraft/config/ProjectEssentials/permissions.json

Configuration documentation

groups configuration section

groups - contains an array of groups, each element of the array (group) must have the name, isDefault and permissions properties, if there is no property, the default value will be used, but I strongly recommend adding all the properties manually.

name - is the name of the group; it should preferably not contain any characters other than letters; This property is required.

isDefault - only accepts a boolean value; if false, the group will not be set by default; if true, the group will be used as the default; Note: at least one group must have the value true, if this is not the case, I do not know what will happen, I did not check.

permissions - is a string array, it just records the rights for a specific group. If you are not familiar with json, I strongly recommend that you get familiar with it. Note: If the permissions array has "*", then this is equivalent to the operatorโ€™s permissions or just gives all the permissions that the PermissionsAPI controls.

inheritFrom - is a string array. Contains groups in which permissions must be inherited. For example: Supporter-1 group inherit Default permissions, etc.

users configuration section

users - contains an array of users, each element of the array (user) must have the nickname, group and permissions properties, if there is no property, the default value will be used, but I strongly recommend writing all the properties manually.

nickname - is the nickname of the player; it should preferably not contain any characters other than letters; This property must be required.

group - is the name of the group in which the player is entitled.

permissions - is a list of rights that belong to a specific player, they can serve as a finer setting of rights; Note: If the player has a group, then the rights that are written by the player will be added to the rights that he received from the group. In short: these are just additional rights for the player.

Just in case

If something goes according to the cunt, and your configuration flies, just delete the configuration or take the default configuration from here.

Minimal default configuration:

{
  "groups": [
    {
      "name": "default",
      "isDefault": true,
      "permissions": []
    },
    {
      "name": "owner",
      "isDefault": false,
      "permissions": ["*"]
    }
  ],
  "users": [
    {
      "nickname": "*",
      "group": "default",
      "permissions": []
    }
  ]
}

And with default permissions:

{
    "groups": [
        {
            "name": "default",
            "isDefault": true,
            "permissions": [
                "native.help",
                "native.list",
                "native.me",
                "native.message",
                "native.teammsg",
                "native.tell",
                "native.trigger",
                "native.w",
                "native.event.modifyworld",
                "ess.warp",
                "ess.warp.set",
                "ess.warp.remove",
                "ess.chat",
                "ess.chat.mention.all",
                "ess.home",
                "ess.home.set",
                "ess.home.remove",
                "ess.spawn",
                "ess.afk",
                "ess.sendpos",
                "ess.tpaccept",
                "ess.tpdeny",
                "ess.tptoggle",
                "ess.tpaall",
                "ess.tpacancel",
                "ess.tpa",
                "ess.tpahere"
            ],
            "inheritFrom": []
        },
        {
            "name": "owner",
            "isDefault": false,
            "permissions": ["*"],
            "inheritFrom": ["default"]
        }
    ],
    "users": [
        {
            "nickname": "*",
            "group": "default",
            "permissions": []
        }
    ]
}

API in Using

Dev. Dependencies 1.14.4

    - kotlin-std lib version: 1.3.61
    - kotlinx serialization version: 0.14.0
    - forge version: 1.14.4-28.1.114
    - brigadier version: 1.0.17
    - target jvm version: 1.8

Dev. Dependencies 1.15.2

    - kotlin-std lib version: 1.3.61
    - kotlinx serialization version: 0.14.0
    - forge version: 1.14.4-31.1.1
    - brigadier version: 1.0.17
    - target jvm version: 1.8

Get as Dependency

:: For Forge 1.14.4 only ::

repositories {
    maven { url("https://jitpack.io") }
}

dependencies {
    compile(
        group: "com.github.projectessentials",
        name: "ProjectEssentials-Permissions",
        version: "v1.14.4-1.+"
    )
}

:: For Forge 1.15.2 only ::

repositories {
    maven { url("https://jitpack.io") }
}

dependencies {
    compile(
        group: "com.github.projectessentials",
        name: "ProjectEssentials-Permissions",
        version: "v1.15.2-1.+"
    )
}

API Documentation

PermissionsAPI.hasPermission

- accepts:
    - playerNickName - nickname of target player. (string)
    - node - permission node as string, e.g ess.weather (string)
    - isServerSender - needed for additional checking permissions. ((boolean) by default is false)

- return: true if the user has permission, else return false. (boolean)
PermissionsAPI.getAllUserPermissions

- accepts:
    - playerNickName - the nickname of the target player. (string)

- return: list with all able users and groups for user permissions. (list with string type)
PermissionsAPI.getDefaultGroup

- description: NOTE: if default group does not exist then return group without permissions and without a name.

- return: default group in what defined configuration file. (Group class instance)
PermissionsAPI.getGroupPermissions

- accepts:
    - groupName - just group name. (string)
    OR
    - groupInstance - just group class instance. (Group class instance)

- return: list with all able group permissions. (list with string type)
PermissionsAPI.getUserGroup

- accepts:
    - playerNickName - the nickname of the target player. (string)

- return: an instance of the class of the rights group the user belongs to. (Group class instance)
PermissionsAPI.getUserPermissions

- accepts:
    - playerNickName - the nickname of the target player. (string)

- return: list with all able user permissions. (list with string type)
PermissionsAPI.removeGroupPermission

- description: Remove permission node from the group.

- accepts:
    - groupName - just group name. (string)
    - node - group permission. (string)
    OR
    - groupInstance - just group class instance. (Group class instance)
    - node - group permission. (string)
PermissionsAPI.removeUserPermission

- description: Remove permission node from user.

- accepts:
    - playerNickName - nickname of target player. (string)
    node - user permission. setting up for "*" (any) player. (string)
PermissionsAPI.setGroupPermissionNode

- description: Install \ Add new permission for group.

- accepts:
    - groupName - just group name. (string)
    - node - new group permission. (string)
    OR
    - groupInstance - just group class instance. (Group class instance)
    - node - new group permission. (string)
PermissionsAPI.setUserPermissionGroup

- description: Install \ Set a new permission group for the user.

- accepts:
    - playerNickName - nickname of target player. (string)
    - groupName - new user permission group. (string)
    OR
    - playerNickName - nickname of target player. (string)
    - groupInstance - new user permission group. (Group class instance)
PermissionsAPI.setUserPermissionNode

- description: Install \ Add new permission for the user.

- type: MutableList<String>
PermissionsAPI.oppedPlayers

- description: Contain all opped players, for advanced permission checking.

- accepts:
    - playerNickName - nickname of target player. (string)
    - node - new user permission. setting up for "*" (any) player. (string)

If you have any questions or encounter a problem, be sure to open an issue

Last updated

Was this helpful?