{"id":18309121,"url":"https://github.com/typicalam/minecraft-discord-bot","last_synced_at":"2025-04-09T11:30:37.174Z","repository":{"id":152899259,"uuid":"456971471","full_name":"TypicalAM/Minecraft-Discord-Bot","owner":"TypicalAM","description":"A discord bot to manage a local minecraft server","archived":false,"fork":false,"pushed_at":"2024-02-13T00:00:25.000Z","size":6082,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T05:28:59.112Z","etag":null,"topics":["discord-bot","minecraft","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","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/TypicalAM.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,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-02-08T14:40:30.000Z","updated_at":"2022-02-08T15:29:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"0f7d5d32-15f6-43c3-adca-df11d7dd07a1","html_url":"https://github.com/TypicalAM/Minecraft-Discord-Bot","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/TypicalAM%2FMinecraft-Discord-Bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TypicalAM%2FMinecraft-Discord-Bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TypicalAM%2FMinecraft-Discord-Bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TypicalAM%2FMinecraft-Discord-Bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TypicalAM","download_url":"https://codeload.github.com/TypicalAM/Minecraft-Discord-Bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248030968,"owners_count":21036307,"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":["discord-bot","minecraft","python3"],"created_at":"2024-11-05T16:10:19.633Z","updated_at":"2025-04-09T11:30:37.146Z","avatar_url":"https://github.com/TypicalAM.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Minecraft Server Bot\n\nA small discord bot to manage a local minecraft server\n\n---\n\n## Available commands\n\nHere are the commands that the bot can respond to:\n\n- `/status` : Show the status of the server\n\n- `/start` : Start the server if it isn't started yet\n\n- `/stop` : Stop the server if it isn't stopped yet and there are no people\n\n- `/inject` : Owner command to inject a command into the server's console, e.g. `/inject kick my_user` would insert `kick my_user`\n\n- `/lightning` : Strike a player with mighty lightning\n\n---\n\n## Dependencies\n\nInstall the following python packages before you use this bot.\n\n- `mcstatus` : Checking the status of your minecraft server\n\n- `rcon` : Communication with the server using the `rcon` protocol\n\n- `dotenv` : To avoid hard coding sensitive information (like a [Discord Token](https://discord.com/developers/docs/topics/oauth2))\n\n- `discord-py-interactions` : Arriving at your discord server!\n\n- Rcon and query enabled in your minecraft server settings. Here is a [quick rundown of the options](https://minecraft.fandom.com/wiki/Server.properties)\n\n## Installation guide\n\nFollow these steps to get the bot on your server.\n\n- Clone this repo\n\n```shell\ngit clone https://github.com/TypicalAM/Minecraft-Discord-Bot\n```\n\n- Install the dependencies (all of them are available using [pip3](https://pip.pypa.io/en/stable/getting-started/))\n\n```shell\npip3 install -r requirements.txt\n```\n\n- Create and invite a discord bot\n\n[This](https://discordpy.readthedocs.io/en/stable/discord.html) official guide is very helpful in creating the bot and getting the discord token that we need.\n\n- Create the .env file\n\nThe `.env` file inside the project directory is read to get the sensitive data of the application, it should look something like this:\n\n```shell\n# Your discord token\nDISCORD_TOKEN='abc123def'\n# Your rcon password\nRCON_PASS='mypassword'\n# The path where server.jar resides\nSERVER_PATH='/opt/minecraft/Paper'\n# The nickname of the owner of the bot (optional)\nOWNER_NICK='test'\n# The status check frequency (optional)\nSTATUS_CHECK_FREQUENCY='5'\n# The status check amount (optional)\nSTATUS_CHECK_NUMBER='10'\n# The tmux command used to open the minecraft server\nTMUX_COMMAND='tmux new-session -d -s 'java_server' /usr/bin/java -Xmx5G -Xms5G -jar server.jar nogui'\n```\n\nLet's give special attention to the last variable `TMUX_COMMMAND`. This command generates a [tmux](https://www.hamvocke.com/blog/a-quick-and-easy-guide-to-tmux/) session to monitor the console of the Java server. Once the server starts, it can be easily accessed using `tmux attach`.\n\nAn example command for starting a minecraft server would look something like this:\n\n```shell\ntmux new-session -d -s 'java_server' /usr/bin/java -Xmx3G -Xms3G -jar server.jar nogui\"\n```\n\nWhere the amount of RAM used is 3G\n\n- Once the `.env` file is created, we are basically done and we can start the server using the below command. If successful, we should see no errors - if there is an `ImproperlyConfigured` exception it means that some of the initial setup failed (check the description of the error for more info!).\n\n## Additional information\n\nModifications of the bot are allowed, just be sure to read the `interactions.py` docs over [here](https://discord-interactions.readthedocs.io/en/latest/quickstart.html). \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypicalam%2Fminecraft-discord-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftypicalam%2Fminecraft-discord-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypicalam%2Fminecraft-discord-bot/lists"}