{"id":16984022,"url":"https://github.com/ratfactor/ratcraft","last_synced_at":"2026-02-28T10:30:15.036Z","repository":{"id":145254785,"uuid":"267434929","full_name":"ratfactor/ratcraft","owner":"ratfactor","description":"Minimal Bash Minecraft server launch/control/backup script","archived":true,"fork":false,"pushed_at":"2023-09-27T22:59:48.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-12T09:12:18.269Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ratfactor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-05-27T21:59:42.000Z","updated_at":"2023-09-27T22:59:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"cdedde79-d37c-411f-86dc-ea1e5229c004","html_url":"https://github.com/ratfactor/ratcraft","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratfactor%2Fratcraft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratfactor%2Fratcraft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratfactor%2Fratcraft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratfactor%2Fratcraft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ratfactor","download_url":"https://codeload.github.com/ratfactor/ratcraft/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239872621,"owners_count":19711098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T02:29:55.376Z","updated_at":"2026-02-28T10:30:14.697Z","avatar_url":"https://github.com/ratfactor.png","language":"Shell","readme":"# ratcraft\n\n\n**MOVED!** Hello, I am moving my repos to http://ratfactor.com/repos/\nand setting them to read-only (\"archived\") on GitHub. Thank you, _-Dave_\n\n\nMinimal Bash Minecraft server launch/control/backup script.\n\nThe purpose of this script is to daemonize a Minecraft server (run it in the background) using GNU `screen` (present on most UNIX-like OSs) and allow simple control of the server.  It follows the principal of \"the simplest thing which could possibly work.\"\n\nFeatures:\n\n* Start the server and run it in the background\n* Stop the server\n* Run arbitrary Minecraft server commands at the command line\n* Pause Minecraft world saving and create a compressed backup of the world files\n\n## Setup\n\nThere are some settings at the top of the script which you'll likely need to change:\n\n```\nrootdir=~/mcserver\nworld=$rootdir/world\nbackups=$rootdir/backups\njar=~/minecraft_server.1.15.2.jar\nsname=ratcraftscreen\nstart_cmd=\"java -Xms512M -Xmx1024M -XX:ParallelGCThreads=1 -jar '$jar' nogui\"\n```\n\nIn particular, the first four are likely to need some changes. These are my current actual settings.\n\n* `rootdir` - The server's working directory. Minecraft server will populate this with files such as `eula.txt`, `server.properties`, `whitelist.json`, and so forth.\n* `world` - (Directory) This should match the `level-name` property in `server.properties` (which is created when the server first runs - will be `world` by default) and needs to be under the server root directory. Minecraft will populate the world directory with files such as `level.dat`, etc. when it creates the world for the first time.\n* `backups` - (Directory) Again, I've placed this under `rootdir`, but feel free to point this to any valid path. This is where the command `ratcraft backup` will attempt to save `*.tgz` backup files.\n* `jar` - This is the exact name of the Minecraft Java ARchive file (`*.jar`) you wish to run.  Could be a Bukkit or Spigot server or Vanilla Minecraft server from minecraft.net.  You choose the flavor!\n\n## Commands\n\nRun `ratcraft` with arguments to see terse usage instructions:\n\n```\nroot@darkstar:~# ratcraft\nUsage: ratcraft ( start | stop | status | backup | watch | cmd \u003ccommand\u003e )\n```\n\nLet's look at each of these sub-command options in turn:\n\n* `ratcraft start` - Starts the specified Minecraft server .jar under a GNU `screen` session. Runs in the background.\n* `ratcraft stop` - Stops the running server and/or `screen` session.\n* `ratcraft status` - Prints out a neat little summary of the settings and whether or not the server appears to be running. Example below.\n* `ratcraft backup` - Creates a backup of the current running world. (Halts world saving, uses GNU `tar` to create a compressed archive of the world directory, resumes world saving.)\n* `ratcraft watch` - Runs GNU `tail -f` on the Minecraft server log so you can see new log messages as they are written. End with `CTRL+C`.\n* `ratcraft cmd '\u003cyour command\u003e'` - Send a command to the running Minecraft server.  See the examples below.\n\n### status Example\n\nAs promised, here's an example of running the status sub-command. Here's my current server status:\n\n```\nroot@darkstar:~# ratcraft status\nSettings:\n    rootdir:    /root/mcserver\n    world:      /root/mcserver/world\n    backups:    /root/mcserver/backups\n    jar:        /root/minecraft_server.1.15.2.jar\n    sname:      ratcraftscreen (id of screen session)\n    start_cmd:  java -Xms512M -Xmx1024M -XX:ParallelGCThreads=1 -jar '/root/minecraft_server.1.15.2.jar' nogui\nServer is running.\n```\n\n### cmd Examples\n\nYou can talk to your players with `say`:\n\n```\nroot@darkstar:~# ratcraft cmd 'say Hello from the server.'\n...\n[23:03:48] [Server thread/INFO]: [Server] Hello from the server.\n```\n\nOr `teleport` somebody:\n\n```\nroot@darkstar:~# ratcraft cmd 'teleport Ratf -983 24 340'\n```\n\nThe important thing to note in these examples is that the entire command needs to be quoted. Single-quotes are ideal unless you want to use variable interpolation, in which case you already know what you're doing.\n\nAlso note that after your command is sent, the script waits a second and then displays the last three lines from the server log.  Though this should show the server's reaction to your command, it may also be confusing.    This would be a great place for script improvement. Showing only _new_ lines written after the command is sent would be ideal.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fratfactor%2Fratcraft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fratfactor%2Fratcraft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fratfactor%2Fratcraft/lists"}