Skip to main content

Minecraft server status webhook for Discord

Poll a server and send customizable webhook embed if the status changes.

Requires Python 3.7+

Table of contents

Installation

Use python on Windows instead of python3

Update pip and dependencies

$ python3 -m pip install --upgrade pip
$ python3 -m pip install --upgrade setuptools wheel

Install

$ python3 -m pip install --upgrade mc-status-webhook

Usage

$ python3 mc_status_webhook.py -u "<webhook url>" [options]

or set the appropriate environment variables.

See CLI arguments and Environment variables for configuration.

Example scripts are also provided in the 'examples' directory. Get msw-example.cmd for Windows or msw-example.sh for Linux and modify it to your needs.

Note 1: It is strongly recommended to run mc-status-webhook on the same machine or local network as the Minecraft server to avoid false notifications due to connection issues and wasting bandwidth. In this case use the loopback address 127.0.0.1 or the local address of the machine.

Note 2: When working with BungeeCord-based proxies, use -s or --full-status to request full status information, because BungeeCord does not respond to just ping. Note that this will fetch more data such as MOTD, icon, version, sample players and will use more bandwidth if the update time is set too low.

CLI arguments

Argument Type Default Required Description
-H, --host str 127.0.0.1 No Server address
-p, --port int 25565 No Server port
-t, --update-time float 10.0 No Time in seconds between checking the server status
-i, --initial-status bool No Send a webhook with the server status on application start
-s, --full-status bool No Request full status info instead of just pinging (for BungeeCord-based proxies)
-u, --webhook-url str Yes Discord webhook URL
-d, --debug bool No Log debug messages
--online-color str 30c030 No Webhook color hex when the server is online
--offline-color str ff4040 No Webhook color hex when the server is offline
--online-thumb-url str <online icon> No Webhook thumbnail URL when the server is online ('none' = disabled)
--offline-thumb-url str <offline icon> No Webhook thumbnail URL when the server is offline ('none' = disabled)
--status-title str Status No Webhook status title
--status-online-value str Online No Webhook status value when the server is online
--status-offline-value str Offline No Webhook status value when the server is offline
--address-title str Address No Webhook address title
--address-value str No Webhook address value when the server is online

Environment variables

Environment variable Equivalent argument
MSW_HOST -H, --host
MSW_PORT -p, --port
MSW_WEBHOOK_URL -u, --webhook-url
MSW_ONLINE_COLOR --online-color
MSW_OFFLINE_COLOR --offline-color
MSW_ONLINE_THUMB_URL --online-thumbnail-url
MSW_OFFLINE_THUMB_URL --offline-thumbnail-url
MSW_STATUS_TITLE --status-title
MSW_STATUS_ONLINE_VALUE --status-online-value
MSW_STATUS_OFFLINE_VALUE --status-offline-value
MSW_ADDRESS_TITLE --address-title
MSW_ADDRESS_VALUE --address-value

License

MIT license. See LICENSE for more information.

Metadata

Release files for mc-status-webhook 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mc-status-webhook 0.4.0
File Size Uploaded
mc-status-webhook-0.4.0.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mc-status-webhook 0.4.0
File Interpreter ABI Platform
mc_status_webhook-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.6 kB

Release files / mc-status-webhook-0.4.0.tar.gz

Download URL mc-status-webhook-0.4.0.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1593452929d0b96840c6c1f9ff2b150b3e0c91265cac50b45edf312a9bc36f01
BLAKE2b-256 checksum
How to use checksums
bb81fed8729f08921383a45f16184c1e86e4a7ed885d0862c6764f4fe89f1319
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

Release files / mc_status_webhook-0.4.0-py3-none-any.whl

Download URL mc_status_webhook-0.4.0-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c925a2509e82fd22bf537fdc1a24de6dbe2aaaa3bb4fa3b8cc13f9c7efc677a7
BLAKE2b-256 checksum
How to use checksums
40579fbe15a72d7ee5cd8a2d04872a522dbb0d15239d2519976758880b8766d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page