Tutorial:Server maintenance

Jump to navigation Jump to search

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

Creating backups[edit | edit source]

Creating a backup of your server is important, because if your server were to crashed, or your world's corrupted, you can always restore it back from 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, 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.

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[edit | edit source]

Reset player[edit | edit source]

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[edit | edit source]

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[edit | edit source]

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[edit | edit source]

Setting the server's resource pack[edit | edit source]

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[edit | edit source]

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.

Resetting the Nether or the End[edit | edit source]

  • 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[edit | edit source]

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[edit | edit source]