Skip to content

EliusHHimel/McOne

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

McOne

One command to set up a Minecraft server on any operating system!

McOne is a simple, cross-platform Minecraft server setup utility that automates the entire process of setting up a Minecraft server. With just one command, you can have a fully functional Minecraft server ready to go.

Features

  • ๐Ÿš€ One-Command Setup: Get your server running with a single command
  • ๐ŸŒ Cross-Platform: Works on Linux, macOS, and Windows
  • ๐ŸŽฏ Smart Version Selection: Automatically fetches latest 5 versions from official sources
  • โœ๏ธ Manual Version Entry: Enter any Minecraft version manually with automatic search
  • ๐Ÿ”„ Multi-Source Support: Falls back to alternative sources if official API is unavailable
  • โ˜• Smart Java Version Detection: Automatically determines and installs the correct Java version for your selected Minecraft version
  • โœ… Java Compatibility Check: Verifies your Java installation meets the requirements before downloading
  • โš™๏ธ Auto-Configuration: Creates all necessary configuration files
  • ๐Ÿ“ฆ Always Up-to-Date: Dynamically fetches the latest versions, no hardcoded lists
  • ๐ŸŽฎ Ready to Play: Server is ready to start immediately after setup

Quick Start

First, clone the repository using the command below or download the repository.

git clone https://github.com/EliusHHimel/McOne

Then open the folder

cd McOne

Linux / macOS

Open your terminal and run:

bash setup.sh

Windows

Choose one of the following methods:

Method 1: Command Prompt

setup.bat

Method 2: PowerShell

.\setup.ps1

Note: If you get an execution policy error in PowerShell, run:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Prerequisites

  • Java - Version depends on the Minecraft server version you choose:
    • Minecraft 1.21+ โ†’ Java 21
    • Minecraft 1.20.5+ โ†’ Java 21
    • Minecraft 1.18-1.20.4 โ†’ Java 17
    • Minecraft 1.17 โ†’ Java 17
    • Minecraft 1.12-1.16.5 โ†’ Java 11
  • Python 3 (optional but recommended) - Enables dynamic version fetching from official sources
  • The setup script will automatically detect the required Java version and verify compatibility
  • On Linux, you may need sudo privileges for automatic Java installation

What Does It Do?

The setup script will:

  1. โœ… Detect your operating system
  2. โœ… Fetch the latest 5 Minecraft versions from official Mojang API (requires Python 3)
  3. โœ… Display an interactive menu to select a version or enter one manually
  4. โœ… Search multiple sources to find your specified version
  5. โœ… Automatically determine the required Java version for your selected Minecraft version
  6. โœ… Verify that your installed Java version is compatible
  7. โœ… Check for Java installation (offers to install the correct version if missing on Linux/macOS)
  8. โœ… Create a server directory
  9. โœ… Download your chosen Minecraft server JAR file
  10. โœ… Accept the Minecraft EULA
  11. โœ… Create a default server.properties configuration
  12. โœ… Generate launch scripts for your platform

Version Selection

The setup script offers two modes:

With Python 3 (Recommended)

  • Automatically fetches the latest 5 versions from Mojang's official API
  • Displays them in an interactive menu
  • Option to enter any version manually (e.g., 1.19.4, 1.18.2, etc.)
  • Searches multiple sources including:
    • Mojang's official version manifest
    • jars.vexyhost.com (fallback)
    • Direct URL patterns
  • Caches version data for 24 hours to speed up subsequent runs

Without Python 3 (Fallback)

  • Uses a hardcoded list of latest 5 stable versions
  • Still fully functional for common versions
  • Updates periodically with script updates

Starting Your Server

After setup completes, navigate to the server directory and run the start script:

Linux / macOS

cd server
./start.sh

Windows

cd server
start.bat

Server Configuration

The server is created with these default settings:

  • Port: 25565 (default Minecraft port)
  • Game Mode: Survival
  • Difficulty: Normal
  • Max Players: 20
  • RAM: 2GB max, 1GB min (can be adjusted in start scripts)

You can modify these settings by editing the server/server.properties file.

Memory Configuration

The default start scripts allocate 2GB of RAM to the server. To change this, edit the start script:

Linux/macOS (start.sh):

java -Xmx4G -Xms2G -jar server.jar nogui

Windows (start.bat):

java -Xmx4G -Xms2G -jar server.jar nogui

Replace 4G and 2G with your desired maximum and minimum memory allocation.

Connecting to Your Server

  1. Start Minecraft (Java Edition)
  2. Go to Multiplayer
  3. Add Server
  4. Enter your server address:
    • Local: localhost or 127.0.0.1
    • LAN: Your local IP address (e.g., 192.168.1.100)
    • Public: Your public IP address (port forwarding required)

Port Forwarding (For Public Servers)

To allow players outside your network to connect:

  1. Access your router's admin panel
  2. Forward port 25565 (TCP/UDP) to your computer's local IP
  3. Share your public IP address with players

Troubleshooting

Java Not Found

If Java is not installed:

  • Windows: Download from Adoptium
  • macOS: Install via Homebrew: brew install openjdk@17
  • Linux: Use your package manager (apt, yum, dnf, pacman)

Permission Denied (Linux/macOS)

Make the script executable:

chmod +x setup.sh
cd server
chmod +x start.sh

Server Won't Start

  • Ensure Java 17+ is installed: java -version
  • Check that port 25565 is not already in use
  • Verify you have enough RAM available

Download Failed

If the automatic download fails:

  1. Manually download server.jar from Minecraft.net
  2. Place it in the server directory
  3. Run the setup script again (it will skip the download)

Directory Structure

After setup, your directory will look like this:

McOne/
โ”œโ”€โ”€ setup.sh          # Setup script for Linux/macOS
โ”œโ”€โ”€ setup.bat         # Setup script for Windows (CMD)
โ”œโ”€โ”€ setup.ps1         # Setup script for Windows (PowerShell)
โ”œโ”€โ”€ README.md         # This file
โ””โ”€โ”€ server/           # Created by setup
    โ”œโ”€โ”€ server.jar    # Minecraft server
    โ”œโ”€โ”€ eula.txt      # EULA acceptance
    โ”œโ”€โ”€ server.properties  # Server configuration
    โ”œโ”€โ”€ start.sh      # Launch script (Linux/macOS)
    โ””โ”€โ”€ start.bat     # Launch script (Windows)

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

License

This project is provided as-is for educational and personal use.

Disclaimer

  • By using this script, you agree to the Minecraft End User License Agreement
  • This is an unofficial tool and is not affiliated with Mojang or Microsoft
  • Always keep your server software up to date for security

Support

If you encounter issues or have questions:

  1. Check the Troubleshooting section above
  2. Review the Minecraft Server Wiki
  3. Open an issue on this repository

Happy Mining! โ›๏ธ

About

One command to set up a Minecraft server on any operating system!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors