Skip to content

Instantly share code, notes, and snippets.

@moxwel
Last active February 6, 2023 15:27
Show Gist options
  • Save moxwel/a819ac6607e58a12f76f017c1c806509 to your computer and use it in GitHub Desktop.
Save moxwel/a819ac6607e58a12f76f017c1c806509 to your computer and use it in GitHub Desktop.
Setup LuckPerms plugin for Minecraft Server

#2 | LuckPerms plugin setup for Minecraft Server

πŸ“š Index
  1. minecraft_server_crossplay.md GitHub Gist last commit

  2. ➑ minecraft_server_luckperms.md GitHub Gist last commit

  3. minecraft_server_authme.md GitHub Gist last commit

  4. minecraft_server_easycommandblocker.md GitHub Gist last commit


Using PaperMC as backend server (version 1.14.4) and Velocity as proxy with "modern" forwarding.

NOTE: Permissions between proxy and backend are independent. If you want to set permissions to proxy commands like /linkaccount from Floodgate, LuckPerms must be installed on proxy too.

Config

  • πŸ”€ /velocity/plugins/luckperms/config.yml:

    server: global                      # Share context with backend.
    
    allow-invalid-usernames: true       # Enable if using GeyserMC/Floodgate.
  • πŸ“ƒ /paper/plugins/luckperms/config.yml:

    server: global                      # Share context with proxy.
    
    enable-ops: false                   # Disable vanilla OP management.
    auto-op: false                      # Disable vanilla OP management.
    commands-allow-op: false            # Disable LuckPerms for OPs.
    
    allow-invalid-usernames: true       # Enable if using GeyserMC/Floodgate.

TIP: You may want to share permissions settings between proxy and backend. See this.

  • Permissions: Commands that can be enabled or disabled.
    Syntax: plugin.command.[...]

    • All commands: *

    • All Minecraft commands: minecraft.*

    • All Bukkit commands: bukkit.*

    • Help command from Minecraft: minecraft.command.help

If you want to manage permissions of backend server commands like /ban, you must install LuckPerms on backend.

If you want to manage permissions of proxy commands like /linkaccount (from Floodgate), you must install LuckPerms on proxy.

  • Groups: Collection of permissions. Assigned to players. All players start with the "default" group.
    Example: "default", "moderator", "operator", "owner", etc.

    • Parent: Group from whom inherits all permissions.
      Example: "operator" with parent "moderator" moderator β†’ operator
      (Group "operator" will have all permissions from "moderator" too.)
  • Tracks: Collection of groups ordered in a hierarchical way.

    • Groups must be parented with previous lower level permission.
      Example: "default" β†’ "moderator" β†’ "operator" β†’ "owner"

Common commands

  • Main: /lp for server, /lpv for proxy

  • Web editor: /lp editor

  • Command tree: /lp tree

  • Verbose report record: /lp verbose record /lp verbose paste

    • Verbose report live: /lp verbose on !internal/internal/commandblock & !internal/internal/console & !internal/console

    • Verbose report for player: /lp verbose on <player>

  • Promote/demote user along track: /lp user <player> {promote|demote}

    • If player is in group with more than one track: /lp user <player> {promote|demote} <track>
  • Assign group to player: /lp user <player> parent set <group>

Permissions

πŸ“ƒ Vanilla-like permissions (backend server)

  • Groups: default - operator

  • Track: main ( default β†’ operator )

defaultoperator
weight.100βœ”οΈweight.200βœ”οΈ
*❌group.defaultβœ”οΈ
minecraft.command.helpβœ”οΈminecraft.*βœ”οΈ
minecraft.command.listβœ”οΈminecraft.command.save-all❌
minecraft.command.meβœ”οΈminecraft.command.save-off❌
minecraft.command.msgβœ”οΈminecraft.command.save-on❌
minecraft.command.teammsgβœ”οΈminecraft.command.stop❌
minecraft.command.triggerβœ”οΈ

"Weight" in simple, defines group priority. Read this.

With this setup, available commands will "emulate" vanilla commands. ALL plugins commands will be disabled.

To give OP, must promote to operator group. They will not have access to level 4 commands (e.g. /stop).

You can compact permissions with shorthands, for example default group can be compacted to:
minecraft.command.{help,list,me,msg,teammsg,trigger}

πŸ”€ Vanilla-like permissions (proxy server)

  • Groups: default
default
*❌
floodgate.command.linkaccountβœ”οΈ
floodgate.command.unlinkaccountβœ”οΈ
geyser.command.advancementsβœ”οΈ
geyser.command.offhandβœ”οΈ

All proxy commands will be disabled except Floodgate linking commands and Geyser utility and informational commands.

LuckPerms in-game permissions

  • Groups: operator
operator
luckperms.user.promoteβœ”οΈ
luckperms.user.demoteβœ”οΈ
luckperms.user.infoβœ”οΈ
luckperms.user.permission.infoβœ”οΈ
luckperms.group.listmembersβœ”οΈ
luckperms.group.infoβœ”οΈ
luckperms.group.permission.infoβœ”οΈ

Append to current permissions.

With this setup you will be able to promote/demote players in-game and view some information about their permissions but every permission management is done in the console. Change permissions if you dont want that.

Extras

Promote/demote alias

  • πŸ“ƒ /paper/commands.yml:

    aliases:
      promote:
      - lp user $$1 promote main
      demote:
      - lp user $$1 demote main

Set shared database as storage method

Must do this if want to share permissions between proxy and backend.

TIP: You can use Supabase to host a free PostgreSQL database.

First export data with /lp export <filename>.

  • πŸ”€ /velocity/plugins/luckperms/config.yml:

    storage-method: postgresql      # Select database.
    data:
      address: '<address>:5432'
      database: postgres
      username: postgres
      password: '<password>'
    
    messaging-service: pluginmsg    # Messaging system between proxy and backend. Must match.
  • πŸ“ƒ /paper/plugins/luckperms/config.yml:

    storage-method: postgresql      # Select database.
    data:
      address: '<address>:5432'
      database: postgres
      username: postgres
      password: '<password>'
    
    messaging-service: pluginmsg    # Messaging system between proxy and backend. Must match.

Then import data with /lp export <filename>.

To force synchronization between proxy and backend use /lp networksync.

⬆ Go to top

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment