Minecraft Server Console Basic User Management

Published on January 16, 2022 at 7:39 am by LEW

Minecraft ImageIntroduction

What follows in are some console commands for managing users on the Debian 11 Minecraft build described in this series of posts.

There are console commands for both modifying and managing users. In this post we will be focused on the management aspect.

Please note these commands do sometimes change with the type of Minecraft installed and the version. This post covers Vanilla Minecraft version 1.18.

Making a Server Private

In the server.properties file, located in the Minecraft directory, there is a line with the property whitelist. Setting this property to true will only allow users listed in the whitelist.json file, also in Minecraft directory, to log onto the server. This gives the administrator complete control over who uses the server.

The whitelist.json file has specific formatting requirements. You should avoid editing it by hand. Rather use the built in commands for managing it.

Note, all Minecraft commands start with a forward slash, and must be entered in a running instance of the server. If you followed the previous posts, and are logged into the server as the Minecraft user, then an instance of the program should be running in a detached screen. Please see previous posts here and here for information on accessing the running program.

Whitelisting Players on Private Server

When turned on, whitelist will prevent anonymous users from logging into the server. However, there visit and attempt will be in the usercache.json file. Therefor if you enter the following command into the Minecraft server interface, you can add that user to the whitelist.

/whitelist add <user_name>

To review the white listed users, enter the following command.

/whitelist list

If you have a problematic user you want to remove from the server, use this command.

/whitelist remove <user_name>

If you simply must modify the whitelist.jason file manually, then you will need to use the following command in the server to resync it.

/whitelist reload

Managing Players on Open Server

This means a non whitelisted server. Two additional files can be found in the Minecraft directory, banned-players.json and banned-ips.json. These files are used to track banned players and banned IP addresses. If players or IP addresses show up in these lists, they will not be able to log into an open server. Below are some of the commands for working with these lists.

To ban a player from the server use the following command.

/ban <user_name> [reason]

The reason is totally optional, and if used will be displayed when the player tries to log on.

Banning an IP address is similar. Note this only bans a single IP address, and wildcard matching is not allowed.

/ban-ip <ip_address> [reason]

If you need to see a list of banned players or IP addresses, then use one of the appropriate following commands.

/banlist player

/banlist ip

If you want to allow a banned player or IP address back onto your server, then you can use the following commands.

/pardon <user_name>

/pardon-ip <ip_address>

Some Miscellaneous User Management Commands

Here are a couple of general user management commands.

This one lists the players currently logged into the server by either user name or UUID (not sure how useful UUID actually is for players on a Minecraft server).

/list

/list uuids

This next one allows the administrator to kick a player off the server. For example, you banned a player currently logged in, the ban stops them from logging back in, but you would use /kick to stop their current session. A reason is optional in this command.

/kick <user_name> [reason]

Conclusion

The above should take care of most basic Minecraft user management.

There will be followup posts on actually modifying the user character, and the environment at some point.

Add New Comment

Your email address will not be published. Required fields are marked *