42 Permissions
Andreas Troelsen edited this page 2023-11-13 14:44:34 +01:00

Table of Contents

1. Sane Defaults

MobArena uses "sane defaults", which means that it is permissive for usage and restrictive for setup:

  • All players have access to all arenas and all classes as well as user commands
  • Only ops have access to admin and setup commands

This means that a permissions plugin is not required for MobArena to work. If all you want to do is fire up your server, set up an arena, and start playing, you don't need to tinker with permissions.

If, however, you want to limit access to certain arenas or classes, the rest of this page explains how to do so. Examples are given using the permissions plugin LuckPerms, but all permissions plugins should support this kind of setup.

The next section explains how to set up the permission groups used on the rest of the page.

2. Permission Groups

The rest of the page assumes that there are three permission groups:

  • A default permission group that all players belong to by default. We want this group to have access to only a few arenas and classes.
  • A gladiator permission group that inherits from default. We want this group to have access to additional arenas and classes.
  • An admin permission group, which we want to allow players to run admin commands like /ma kick.

If you don't already have these groups, create them now.

2.1. LuckPerms Example

Use the /lp creategroup command to create the gladiator and admin groups (default already exists):

/lp creategroup gladiator
/lp creategroup admin

Make the gladiator group inherit from default:

/lp group gladiator parent add default

Give the gladiator group a higher weight than the default group:

/lp group gladiator setweight 100

Note that you may need to set a higher weight than 100 if your default group has a weight set.

3. Arenas

Arena permissions follow the format mobarena.arenas.<slug>, where <slug> is the kebab-case version of the arena name, i.e. lowercase and with dashes for spaces. For example, if you have an arena named "Tropical Island", the correct permission key will be mobarena.arenas.tropical-island.

Assuming we have arenas named Castle (castle), Jungle (jungle), and Area 52 (area-52):

  • The default permission group should only have access to Castle, but not Jungle and Area 52.
  • The gladiator group should have access to all three arenas.

Because MobArena is permissive by default, we don't have to do anything to give default access to Castle. To prevent the default group from using Jungle and Area 52, revoke the permissions from the group.

Because the gladiator group inherits from the default group, it may be necessary to explicitly grant permission to Jungle and Area 52.

3.1. LuckPerms Example

Use the /lp group <group> permission set <perm> <value> command to revoke and grant permissions to the default and gladiator groups.

First, revoke permissions for the default group:

/lp group default permission set mobarena.arenas.jungle false
/lp group default permission set mobarena.arenas.area-52 false

Then, grant permissions for the gladiator group:

/lp group gladiator permission set mobarena.arenas.jungle true
/lp group gladiator permission set mobarena.arenas.area-52 true

4. Classes

Class permissions follow the format mobarena.arenas.<slug>, where <slug> is the kebab-case version of the class name, i.e. lowercase and with dashes for spaces. For example, if you have a class named "Heavy Arnold", the correct permission key will be mobarena.classes.heavy-arnold.

Assuming we have classes Archer (archer), Knight (knight), and Beast Master (beast-master):

  • The default permission group should only have access to Archer and Knight, but not Beast Master.
  • The gladiator group should have access to all three classes.

Because MobArena is permissive by default, we don't have to do anything to give default access to Archer and Knight. To prevent the default group from using Beast Master, revoke the permission from the group.

4.1. LuckPerms Example

Use the /lp group <group> permission set <perm> <value> command to revoke and grant permissions to the default and gladiator groups.

First, revoke permission for the default group:

/lp group default permission set mobarena.classes.beast-master false

Then, grant permission for the gladiator group:

/lp group gladiator permission set mobarena.classes.beast-master true

5. Commands

MobArena commands are divided into three different groups: user, admin, and setup. Each one of these groups have a parent permission node that can be used to control access to the entire command group.

5.1. User Commands

Parent node: mobarena.use

Command Permission
/ma join mobarena.use.join
/ma leave mobarena.use.leave
/ma spec mobarena.use.spec
/ma ready mobarena.use.ready
/ma class mobarena.use.class
/ma arenalist mobarena.use.arenalist
/ma playerlist mobarena.use.playerlist
/ma notready mobarena.use.notready

5.2. Admin Commands

Parent node: mobarena.admin

Command Permission
/ma enable - mobarena.admin.enable
/ma disable - mobarena.admin.enable
/ma kick - mobarena.admin.kick
/ma restore - mobarena.admin.restore
/ma force - mobarena.admin.force
/ma addreward - mobarena.admin.addreward

5.3. Setup Commands

Parent node: mobarena.setup

Command Permission
/ma config mobarena.setup.config
/ma setup mobarena.setup.setup
/ma edit mobarena.setup.editarena
/ma setting mobarena.setup.setting
/ma addarena mobarena.setup.addarena
/ma removearena mobarena.setup.removearena
/ma removespawnpoint mobarena.setup.spawnpoints
/ma removecontainer mobarena.setup.containers
/ma removeleaderboard mobarena.setup.leaderboards
/ma checkdata mobarena.setup.checkdata
/ma checkspawns mobarena.setup.checkspawns
/ma classchest mobarena.setup.classchest
/ma listclasses mobarena.setup.classes
/ma autogenerate mobarena.setup.autogenerate
/ma load-item mobarena.setup.loaditem
/ma save-item mobarena.setup.saveitem
/ma delete-item mobarena.setup.deleteitem

5.4. LuckPerms Example

Use the /lp group <group> permission set <perm> <value> command to grant permissions to the admin group:

/lp group admin permission set mobarena.admin true`

This allows players in the admin permission group to use all admin commands.

6. Miscellaneous

Aside from arenas, classes, and commands, MobArena has the following additional permissions:

Permission Description
mobarena.admin.teleport Allows teleporting in arenas
mobarena.admin.errors Get notified on arena errors.
mobarena.setup.leaderboards For setting up Leaderboards