Building Minecraft Server Modifications - Second Edition by Cody M. Sommer

Building Minecraft Server Modifications - Second Edition by Cody M. Sommer

Author:Cody M. Sommer [Sommer, Cody M.]
Language: eng
Format: epub, azw3, pdf
Publisher: Packt Publishing
Published: 2015-12-22T23:00:00+00:00


Understanding permission nodes

A permission node is a string that usually contains multiple words separated by periods. These permission nodes are given to players to give them special privileges on the server. An example of this is minecraft.command.give, which is the permission node that is needed to execute the give command. As you can see, it can be broken down into three parts, namely, the creator (Minecraft), the category (command), and the specific privilege (the give command). You will find most permission nodes structured this way. For a plugin, its permission nodes begin with the name of the plugin. This helps prevent any collision of nodes. If two plugins were to use the same permission node, then an administrator cannot limit access to one node and not the other node. You will also find that many plugins' permission nodes are only two words long. This is done when the plugin does not have many permissions. Therefore, there is no need for categories. On the other hand, for large plugins, you may wish to include numerous nested categories.

To help you understand permission nodes, we will create a permission node for the Enchanter plugin. The first word of the permission node will be the name of the plugin, while the second word will be the name of the command. If the permission node is directly related to a specific command, then it is wise to use the command name within the permission node. This will make your permissions simple to understand and easy to remember. The permission node for the enchant command will be enchanter.enchant. If we expect this plugin to have several permissions, then we can use enchanter.command.enchant instead. Either permission node is fine, but we will use the former in our example. Note that most developers tend to keep their permission nodes in lowercase. This is optional, but it usually prevents errors when typing in the node later. Once we have decided upon a permission node, we must add it to plugin.yml in order to use it with a plugin.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.