Source: https://waylonwalker.com/docker-minecraft-server/
# Start server
docker compose up -d
# Update server to latest version
docker-compose down
docker compose pull
docker-compose up --force-recreate --build -d
docker image prune -f
# Generate New World
cd ~/Docker/minecraftServer/data
docker-compose down
rm -rf {world/,logs/,*.properties}
docker compose pull
docker-compose up --force-recreate --build -d
docker image prune -f
# How To Reset the World on Your Minecraft Server
cd ~/Docker/minecraftServer/data
docker-compose down
# rm -rf {world/,logs/,*.txt,*.json,*.properties}
rm -rf {world/,logs/,*.properties}
# rm -rf backups/playerdata/ && cp -r world/playerdata/ backups/
# rm -rf {world/!(playerdata),logs/,*.txt,*.json,*.properties}
docker-compose up --force-recreate --build -d
# Open/Attach minecraft server Console
#NOTE: Press Ctrl-P, followed by Ctrl-Q, to detach from your connection.
docker attach minecraft
# Game Rules
#(https://nodecraft.com/support/games/minecraft/using-gamerules-in-minecraft#h-list-of-gamerules-fc34423d4)
/whitelist off/on
/gamerule doImmediateRespawn true #Players respawn immediately without showing the death screen
/gamerule keepInventory true #Whether the player should keep items in their inventory after death
/gamerule logAdminCommands true #Whether the player should keep items in their inventory after death
/gamerule pvp true #Whether the player can fight with other players
# Game Commands
#(https://minecraft.fandom.com/wiki/Commands)
#(https://www.ign.com/wikis/minecraft/Console_Commands_and_Cheats_List#All_Console_Commands_and_Cheats_List)
/op @a #Grants All players operator status on the server.
/op playername #Grants playername operator status on the server.
/gamemode creative #Switch your server to Creative Mode
/gamemode survival #Switch your server to Survival Mode
/locate structure village #Find villages GPS
/tp [player] [x y z] #Teleport a player to a specific location
/experience add <player> <amount> #Give a player free experience points
/difficulty <level> #Change the difficulty of your game (Peaceful, Easy, Normal, or Hard)
/weather <type> #Change the weather
/time set night #Set night
/give <player> <item> [quantity] #Give a player free items
/summon <entity> [x y z] #Create a mob at the select location
/execute as @e[limit=16] run summon minecraft:zombie ~ ~ ~ #Spawn lot of zombie (https://www.digminecraft.com/mobs/index.php)
/give @p netherite_sword{Enchantments:[{id:sharpness,lvl:100000000},{id:sweeping,lvl:100}],Unbreakable:1,HideFlags:5}
/give @p crossbow{Enchantments:[{id:mending,lvl:1},{id:multishot,lvl:1},{id:piercing,lvl:4},{id:quick_charge,lvl:5},{id:unbreaking,lvl:3}],HideFlags:1}
/locate structure village #Find villages GPS
1.21 Java Edition - https://beebom.com/best-minecraft-1-21-seeds/
Seed Code: -7833842402223417925
Spawn Biome: Forest
Coordinates for the first trial chamber south from spawn: X: 7 Z: 345
Coordinates for the first village south from spawn: X: 64 Z: 656
Coordinates for the second trial chamber south from spawn: X: 7 Z: 855
Coordinates for the third trial chamber south from spawn: X: -9 Z: 1193