Player Roles

Role & permission management for Fabric servers

Редакция NLZONE · 2 мин чтения · 1 просмотр
Player Roles
Скачать Player Roles1.16.4 – 26.3 · с официальной страницы: modrinth.com
Перейти к загрузке

Что это

Role & permission management for Fabric servers

  • Тип: мод
  • Загрузчик: fabric
  • Версии Minecraft: 1.16.4 – 26.3
  • Скачиваний на Modrinth: 45 295

Подробно

Player Roles for Fabric This is a simple implementation allowing for custom permissions to be assigned to players via Discord-like "roles". Roles and their permissions are defined within a JSON file, which can be easily modified and reloaded at runtime for rapid iteration.

The roles.json file is located in the config directory ( /config/roles.json). An example configuration may look like: json { "admin": { "level": 100, "overrides": { "namedecoration": { "style": ["red", "bold"], "suffix": {"text": ""} }, "permissionlevel": 4, "commandfeedback": true, "commands": { ".": "allow" } } }, "spectator": { "level": 10, "overrides": { "commands": { "gamemode (spectator|adventure)": "allow" } } }, "mute": { "level": 1, "overrides": { "mute": true } }, "everyone": { "overrides": { "commands": { "help": "allow", ".": "deny" } } } }

But what's going on here? This JSON file is declaring three roles: admin, spectator and everyone.

everyone is the default role: every player will have this role, and it cannot be removed. The other roles that are specified function as overrides on top of the everyone role.

Overrides Within each role declaration, we list a set of overrides. Overrides are the generic system that this mod uses to change game behavior based on roles. Currently, the supported override types are commands, namedecoration, chattype, mute, commandfeedback, permissionlevel and entityselectors.

It is important to consider how overrides are applied when multiple roles target the same things. Conflicts like this are resolved by always choosing the role with the highest level. So, in the case of the example: although everyone declares every command except help to be disallowed, because admin and spectator have higher levels, they will override this behaviour.

Commands The commands override is used to manipulate the commands that a player is able to use. Each override entry specifies a regular expression pattern to match, and then a strategy for how to respond when the mod encounters that pattern.

For example, the pattern . matches every possible command, while gamemode (spectator|adventure) would match the gamemode command only with spectator and adventure mode. The strategies that can then be used alongside these patterns are allow and deny: allow will make sure that the player is allowed to use this command, while deny will prevent the player from using this command.

Как установить

Скачайте файл на официальной странице ниже и положите его в папку mods (для модов) или plugins (для плагинов) вашего сервера или клиента. Для модов нужен совместимый загрузчик. Версия должна совпадать с версией Minecraft.

Текст подготовлен автоматически из описания на Modrinth и ждёт проверки редакцией.

Редакция NLZONE

Пишем о серверах, модах и играх, в которые играем сами. Нашли ошибку — напишите нам, исправим.

Комментарии 0

Комментарии к этому материалу отключены.

Читайте также