Tutorial:Server maintenance

Once setting up a server, there are various maintenance tasks required to keep a server in good shape.

Creating backups

Creating a backup of your server is important, because if your server were to crash, or if your world were to corrupt, you can always restore it back to your latest backup without losing any important progress.

In order to make a backup of your server, you'd need to close your server first. Run /save-all command before closing to save the world (only needed in Java Edition), then run /stop to stop the server. Create a copy of your entire server directory, and put it in another drive or storage. To keep track of your server backup, you can put a date or a timestamp on your backup server directory.

In Bedrock Edition, you can also create a backup without closing the server. Run /save hold to pause file writing so you can make the backup without the server modifying the files during the progress. Run /save query to see if the preparation has finished. After success, this will return a list of files you need to copy for the backup. When you've finished creating a backup, you can run /save resume to enable file writing again.

If you only need to create a world backup, you can create a copy of the server's world directory. Usually backing up the entire server directory is recommended, as you get to copy and backup your server configurations, such as banned-ips.json, banned-players.json, and server.properties.

Managing players

Reset player

If you want to reset a player's inventory, position, or any other related data about them, you can remove the player's .dat file. Navigate to the Minecraft server directory, open the world folder, open the player's folder, and delete the .dat file which has the UUID that corresponds to the player's current username. This folder is at "minecraft\world\players", where "minecraft" is the folder where Minecraft was installed on the server. This will cause the player to start over at the spawn point with no inventory and no items in their ender chest. The player's changes to the world will be untouched, along with any inventory stored in chests. This will not ban the player that has been deleted.

Ban player

If you want to ban a player from playing on your server, edit the "minecraft\banned-ips.json" file, where "minecraft" is the folder where Minecraft was installed on the server, and add the user you want to ban to this banned-ips.json file. To ban an IP address from the server, the full IP address must be specified; wildcards are not valid. Players who are banned through this method will see "Your IP address is banned from this server!" when attempting to connect. Alternatively, an operator can use the "ban-ip" command via "/ban-ip ipaddress", where "ipaddress" is the IP address of the user you wish to ban. This can be undone by editing the server's banned-ips.json file or via the operator issuing the "pardon-ip ipaddress" command.

Edit player

If you don't want to delete a player completely, but want to remove something from them or move them to a different spot, or even give them an enchanted item, you can edit the PLAYERUUID.dat file with an NBT editor similar to how you would a level save (The player in question must be offline during this operation, but you do not need to restart the server afterwards). This requires an NBT editor: opening this file with a regular text editor, like Notepad on Windows, will show symbols and random letters/numbers.

Setting textures

This feature is exclusive to Java Edition.
 

Setting the server's resource pack

You can set a default resource pack for your server and the client has the option to download it and use it for your server. (Please note that the client can turn off the resource pack)

  1. Choose or create a resource pack.
  2. Upload the resource pack to Dropbox, or similar. The important thing is that you can have a DIRECT link to the .zip file. (i.e. For Dropbox, find "dl=0" in the link and change it to "dl=1" to make it downloadable)
  3. Set the file to public. (at least on Dropbox or any other file host provider)
  4. Open your server.properties file.
  5. Find resource-pack= and edit it like this: resource-pack=<link to your .zip>.
  6. Restart the server & log on to check the resource pack.

Setting the server's icon

In Java Edition, servers can have an icon that will show up in the Multiplayer list.

  1. Create a PNG image with a size of 64 by 64 pixels, transparency is supported.
  2. Save (or rename) it to server-icon.png.
  3. Move it to the server's directory.
  4. Restart the server.
  5. Server icons will display next to the server name.

Add-ons

This feature is exclusive to Bedrock Edition.
 

Any custom add-on can be applied to worlds on the server. You need to manually import resource packs and behavior packs to the server by pasting the add-on directories the appropriate directories in the server. Behavior packs need to be placed in the development_behavior_packs directory, and resource packs need to be placed in the development_resource_packs directory.

To enable a resource or behavior pack in a world, you need to specify the pack in the world_behavior_packs.json and world_resource_packs.json files respectively. These files need to be created in the working directory of the world in which you want to activate the pack. In this JSON file, you need to specify the UUID of the pack you want to activate, and the version of the pack. The UUID of a pack can be found in the manifest.json file in the directory of the pack.

Example of world_behavior_packs.json contents

world_behavior_packs.json

[
	
	{
		"pack_id" : "33556fcf-d192-4d5f-96a0-29357702af7b",
		"version" : [ 1, 0, 0 ]
	}
]

Note that when you are using multiple packs that can conflict with each other, the highest pack will be prioritized over any following packs.

Enabling add-ons on a world can also be done by applying resource packs or behavior packs in-game in a singleplayer world and then importing the world to the server. This will automatically generate the required JSON files, but the packs themselves still need to be imported to the server.

You can force players to download the server's resource packs by setting texturepack-required in server.properties to true.

Marketplace packs cannot be applied to the server. Players can still enable any client-side resource pack by activating it in the game's global resources, including Marketplace packs. This does not work if texturepack-required is set to true.

Resetting the Nether or the End

  • Ensure there are no players in that dimension, stop the server.
  • In your server world folder, delete the "DIM-1" folder to reset the Nether, and delete the "DIM1" folder to reset the End. Any builds inside those dimensions will be lost, the Ender Dragon will also reappear for the End.
  • Restart the server to apply the changes.

Trimming chunks

Minecraft's world save can grow massively the more players explore. To reduce the world save file size and make travelling to newly generated chunks easier, it makes sense to occasionally remove chunks that have been generated but nothing of note has been built in.

This can be done by manually removing the region files in the world, DIM-1, and DIM1 folders for each region that has been untouched. However, it is easier to use a dedicated tool like mcaselector for automatically selecting chunks that players have spent little time in.

Navigation