Skip to content

Instantly share code, notes, and snippets.

@moxwel
Last active February 24, 2023 12:42
Show Gist options
  • Save moxwel/3c7cc7494a8e5f4cccbfb4a16ca0d649 to your computer and use it in GitHub Desktop.
Save moxwel/3c7cc7494a8e5f4cccbfb4a16ca0d649 to your computer and use it in GitHub Desktop.
Setup AuthMe plugin for Minecraft Server

#3 | AuthMeReloaded 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: The original AuthMeReloaded plugin can only lock commands from backend server, not proxy.

What is mentioned above means, for example: if you are not logged in, the command /unlinkaccount (from Floodgate) can still be executed because that command is from proxy.

To prevent this, you will have to install MTM123's AuthMeReloaded on backend server and MTM123's AuthMeVelocity on proxy.

With Paper 16.5+, the above is not necessary because Geyser and Floodgate can be installed on the same Paper server without using proxy!

Config

Assuming you installed MTM123's versions of AuthMeReloaded and AuthMeVelocity.

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

    authServers:
    - main                            # Set the same name as in proxy config.
    allServersAreAuthServers: true    # Enable for security
    commands:
      requireAuth: true               # Must be enabled to block commands to unlogged players.
      whitelist:                      # Only permits registration commands for unlogged players.
      - /login
      - /register
    chatRequiresAuth: true            # Don't allow chat from unlogged players.
  • πŸ“ƒ /paper/plugins/authme/config.yml:

    settings:
      applyBlindEffect: true     # Blind players until logged.
      useWelcomeMessage: false   # Disable welcome message.
    
      sessions:
        enabled: true            # Don't prompt login if logged recently.
        timeout: 1               # 1 min of waiting.
    
      restrictions:
        allowChat: false                                 # Don't allow chat from unlogged players.
        hideChat: true                                   # Hide chat from unlogged players.
        maxRegPerIp: 0                                   # Disable this for compatibility.
        kickOnWrongPassword: true                        # Enable for security.
        timeout: 35                                      # Kick unlogged players after 35 sec.
        allowedNicknameCharacters: '\.?[a-zA-Z0-9_]*'    # Modify if using GeyserMC/Floodgate.
        allowCommands:                                   # Only permits registration commands for unlogged players.
        - /login
        - /register
    
      registration:
        messageInterval: 10      # Repeat login message every 10 sec.

With this setup, all commands will be blocked except those who permits him to log-in or register.

For clients using Minecraft 1.19+, the proxy can't block signed chat messages and player will be kicked out as safety measure.
The command will not be executed anyway.

πŸ“ƒ Permissions (backend server)

  • Groups: default
default
authme.player.loginβœ”οΈ
authme.player.registerβœ”οΈ
authme.player.changepasswordβœ”οΈ

Append to current permissions.

With this setup, all players can login, register and change their password when are logged in.

Extras

Server join message when logged in

  • πŸ“ƒ /paper/plugins/authme/config.yml:

    settings:
      removeJoinMessage: true      # Remove vanilla messages
      removeLeaveMessage: true
  • πŸ“ƒ /paper/plugins/authme/commands.yml:

    onLogin:
      infoLogin:
        executor: CONSOLE
        command: 'tellraw @a {"text":"%p joined the game","color":"yellow"}'
    onLogout:
      infoLogout:
        executor: CONSOLE
        command: 'tellraw @a {"text":"%p left the game","color":"yellow"}'

⬆ Go to top

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