{"id":127208,"date":"2026-06-07T14:34:38","date_gmt":"2026-06-07T11:34:38","guid":{"rendered":"https:\/\/vpesports.com\/minecraft\/mods\/pythonmcmod\/"},"modified":"2026-06-07T14:34:38","modified_gmt":"2026-06-07T11:34:38","slug":"pythonmcmod","status":"publish","type":"mod","link":"https:\/\/vpesports.com\/minecraft\/mods\/pythonmcmod\/","title":{"rendered":"Python MC Mod"},"content":{"rendered":"<p># PythonMC<\/p>\n<p>PythonMC is a server-side Fabric mod that adds lightweight Python scripting to Minecraft 1.21.1.<\/p>\n<p>It lets server owners write simple Python scripts for common automation, player messages, server events, and command-driven behavior without recompiling the mod.<\/p>\n<p>## Features<\/p>\n<p>&#8211; Loads Python scripts from the server config folder.<br \/>\n&#8211; Starts and manages a local Python 3.8+ script host automatically.<br \/>\n&#8211; Provides server lifecycle, tick, and player connection events.<br \/>\n&#8211; Exposes a small API for logging, broadcasting, private messages, and server command execution.<br \/>\n&#8211; Includes `\/pythonmc` admin commands for status, reloads, restarts, custom events, and quick Python snippets.<br \/>\n&#8211; Ships with an example script on first launch.<\/p>\n<p>## Requirements<\/p>\n<p>&#8211; Minecraft 1.21.1<br \/>\n&#8211; Fabric Loader 0.18.4 or newer<br \/>\n&#8211; Fabric API<br \/>\n&#8211; Java 21<br \/>\n&#8211; Python 3.8 or newer installed on the server<\/p>\n<p>Python must be available as `python3` or `python` on the server `PATH`.<\/p>\n<p>If Python is installed somewhere else, set one of these before launching Minecraft:<\/p>\n<p>&#8220;`text<br \/>\n-Dpythonmc.python=\/path\/to\/python<br \/>\n&#8220;`<\/p>\n<p>or:<\/p>\n<p>&#8220;`text<br \/>\nPYTHONMC_PYTHON=\/path\/to\/python<br \/>\n&#8220;`<\/p>\n<p>## Installation<\/p>\n<p>1. Install Fabric Loader for Minecraft 1.21.1.<br \/>\n2. Install Fabric API.<br \/>\n3. Put the PythonMC jar in the server `mods` folder.<br \/>\n4. Make sure Python 3.8+ is installed on the machine running the server.<br \/>\n5. Start the server once.<\/p>\n<p>PythonMC will create this folder:<\/p>\n<p>&#8220;`text<br \/>\nconfig\/pythonmc\/scripts<br \/>\n&#8220;`<\/p>\n<p>It will also create a starter script:<\/p>\n<p>&#8220;`text<br \/>\nconfig\/pythonmc\/scripts\/main.py<br \/>\n&#8220;`<\/p>\n<p>## Writing Scripts<\/p>\n<p>Scripts are normal `.py` files inside:<\/p>\n<p>&#8220;`text<br \/>\nconfig\/pythonmc\/scripts<br \/>\n&#8220;`<\/p>\n<p>Files whose names start with `_` are ignored. After editing scripts, reload them in-game or from the server console:<\/p>\n<p>&#8220;`text<br \/>\n\/pythonmc reload<br \/>\n&#8220;`<\/p>\n<p>Basic example:<\/p>\n<p>&#8220;`python<br \/>\nimport pythonmc_api as mc<\/p>\n<p>def on_server_started(ctx):<br \/>\n    mc.log(&#8220;PythonMC script loaded.&#8221;)<\/p>\n<p>def on_player_join(ctx):<br \/>\n    mc.tell(ctx[&#8220;name&#8221;], &#8220;Welcome! This message came from PythonMC.&#8221;)<br \/>\n&#8220;`<\/p>\n<p>## Script API<\/p>\n<p>Import the bundled API like this:<\/p>\n<p>&#8220;`python<br \/>\nimport pythonmc_api as mc<br \/>\n&#8220;`<\/p>\n<p>Available functions:<\/p>\n<p>&#8220;`python<br \/>\nmc.log(message, level=&#8221;info&#8221;)<br \/>\nmc.broadcast(message)<br \/>\nmc.tell(player_name, message)<br \/>\nmc.execute(command)<br \/>\n&#8220;`<\/p>\n<p>`mc.execute(command)` runs a Minecraft server command as the server command source. Use it carefully.<\/p>\n<p>## Events<\/p>\n<p>PythonMC calls functions in your scripts when matching events happen.<\/p>\n<p>Supported event handlers:<\/p>\n<p>&#8220;`python<br \/>\ndef on_server_started(ctx): &#8230;<br \/>\ndef on_server_stopping(ctx): &#8230;<br \/>\ndef on_server_tick(ctx): &#8230;<br \/>\ndef on_player_join(ctx): &#8230;<br \/>\ndef on_player_leave(ctx): &#8230;<br \/>\ndef on_shutdown(ctx): &#8230;<br \/>\ndef on_event(event_name, ctx): &#8230;<br \/>\n&#8220;`<\/p>\n<p>The `ctx` object contains event data. It supports both dictionary-style access and `.get()`:<\/p>\n<p>&#8220;`python<br \/>\ndef on_player_join(ctx):<br \/>\n    player_name = ctx[&#8220;name&#8221;]<br \/>\n    player_uuid = ctx.get(&#8220;uuid&#8221;)<br \/>\n&#8220;`<\/p>\n<p>Common player event fields:<\/p>\n<p>&#8220;`text<br \/>\nname<br \/>\nuuid<br \/>\n&#8220;`<\/p>\n<p>Common server event fields:<\/p>\n<p>&#8220;`text<br \/>\nplayers<br \/>\nmax_players<br \/>\ntick<br \/>\nscripts_dir<br \/>\n&#8220;`<\/p>\n<p>## Commands<\/p>\n<p>All commands require permission level 4.<\/p>\n<p>&#8220;`text<br \/>\n\/pythonmc status<br \/>\n\/pythonmc start<br \/>\n\/pythonmc stop<br \/>\n\/pythonmc restart<br \/>\n\/pythonmc reload<br \/>\n\/pythonmc py <python code>\n\/pythonmc event <event_name><br \/>\n&#8220;`<\/p>\n<p>Command details:<\/p>\n<p>&#8211; `\/pythonmc status` shows whether the Python host is running and where scripts are loaded from.<br \/>\n&#8211; `\/pythonmc start` starts the Python script host if it is stopped.<br \/>\n&#8211; `\/pythonmc stop` stops the Python script host.<br \/>\n&#8211; `\/pythonmc restart` restarts the Python script host.<br \/>\n&#8211; `\/pythonmc reload` reloads scripts from `config\/pythonmc\/scripts`.<br \/>\n&#8211; `\/pythonmc py <python code>` runs a Python snippet in the host process.<br \/>\n&#8211; `\/pythonmc event <event_name>` sends a custom event to scripts.<\/p>\n<p>Custom event example:<\/p>\n<p>&#8220;`python<br \/>\nimport pythonmc_api as mc<\/p>\n<p>def on_event(event_name, ctx):<br \/>\n    if event_name == &#8220;maintenance&#8221;:<br \/>\n        mc.broadcast(&#8220;Server maintenance is starting soon.&#8221;)<br \/>\n&#8220;`<\/p>\n<p>Then run:<\/p>\n<p>&#8220;`text<br \/>\n\/pythonmc event maintenance<br \/>\n&#8220;`<\/p>\n<p>## Security Notes<\/p>\n<p>PythonMC scripts run on the server machine with the permissions of the Minecraft server process.<\/p>\n<p>Only install or write scripts you trust. A Python script can perform normal Python file and process operations, and `mc.execute()` can run Minecraft commands from the server command source.<\/p>\n<p>For public or shared servers, restrict `\/pythonmc` command access to trusted operators only.<\/p>\n<p>## Server Side Only<\/p>\n<p>PythonMC is intended for server-side scripting. Clients do not need to install the mod when connecting to a server that uses it, unless your modpack or server setup requires matching mod lists.<\/p>\n<p>## Troubleshooting<\/p>\n<p>If scripts do not start:<\/p>\n<p>&#8211; Run `\/pythonmc status`.<br \/>\n&#8211; Confirm Python 3.8+ is installed.<br \/>\n&#8211; Confirm `python3` or `python` works from the same environment that launches the Minecraft server.<br \/>\n&#8211; Set `-Dpythonmc.python=\/path\/to\/python` if needed.<br \/>\n&#8211; Check the server log for messages tagged with `pythonmc` or `[python]`.<\/p>\n<p>If script changes do not apply:<\/p>\n<p>&#8211; Make sure the file is in `config\/pythonmc\/scripts`.<br \/>\n&#8211; Make sure the filename ends in `.py`.<br \/>\n&#8211; Make sure the filename does not start with `_`.<br \/>\n&#8211; Run `\/pythonmc reload`.<br \/>\n&#8211; Check the server log for Python traceback output.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This mod adds python coding to fabric.<\/p>\n","protected":false},"featured_media":127209,"template":"","meta":{"_minecraft_slug":"pythonmcmod","_minecraft_project_id":"C3SYBh3U","_minecraft_author":"Antara89","_minecraft_license":"CC-BY-4.0","_minecraft_downloads":7,"_minecraft_follows":0,"_minecraft_client_side":"required","_minecraft_server_side":"required","_minecraft_storage_type":"zip","_minecraft_archive_name":"pythonmcmod.zip","_minecraft_size_bytes":435091,"_minecraft_version_count":1,"_minecraft_updated_at":"2026-05-16T12:55:43.710772Z","_minecraft_date_created":"2026-05-08T00:35:16.276767Z","_minecraft_date_modified":"2026-05-06T14:14:47.590698Z","_minecraft_project_url":"https:\/\/modrinth.com\/mod\/pythonmcmod","_minecraft_icon_attachment_id":127209,"_minecraft_imported_at":"2026-06-07T11:34:39+00:00","_minecraft_import_hash":"ad168b21c2f588728107797230d732f9","_minecraft_versions":"","_minecraft_links":"","_minecraft_gallery":"","_minecraft_api_metadata":""},"mod_category":[97,126,92],"mod_loader":[99],"minecraft_version":[37],"class_list":["post-127208","mod","type-mod","status-publish","has-post-thumbnail","hentry","mod_category-fabric","mod_category-management","mod_category-utility","mod_loader-fabric","minecraft_version-1-21-1"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Python MC Mod - Minecraft<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vpesports.com\/minecraft\/mods\/pythonmcmod\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python MC Mod - Minecraft\" \/>\n<meta property=\"og:description\" content=\"This mod adds python coding to fabric.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vpesports.com\/minecraft\/mods\/pythonmcmod\/\" \/>\n<meta property=\"og:site_name\" content=\"Minecraft\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/pythonmcmod\\\/\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/pythonmcmod\\\/\",\"name\":\"Python MC Mod - Minecraft\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/pythonmcmod\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/pythonmcmod\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/pythonmcmod-icon-d37e70c01aeee65cac9d2909d003c7aa4f00351c_96.webp\",\"datePublished\":\"2026-06-07T11:34:38+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/pythonmcmod\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/pythonmcmod\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/pythonmcmod\\\/#primaryimage\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/pythonmcmod-icon-d37e70c01aeee65cac9d2909d003c7aa4f00351c_96.webp\",\"contentUrl\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/pythonmcmod-icon-d37e70c01aeee65cac9d2909d003c7aa4f00351c_96.webp\",\"width\":96,\"height\":96},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/pythonmcmod\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mods\",\"item\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Python MC Mod\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/#website\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/\",\"name\":\"Minecraft\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python MC Mod - Minecraft","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vpesports.com\/minecraft\/mods\/pythonmcmod\/","og_locale":"en_US","og_type":"article","og_title":"Python MC Mod - Minecraft","og_description":"This mod adds python coding to fabric.","og_url":"https:\/\/vpesports.com\/minecraft\/mods\/pythonmcmod\/","og_site_name":"Minecraft","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/vpesports.com\/minecraft\/mods\/pythonmcmod\/","url":"https:\/\/vpesports.com\/minecraft\/mods\/pythonmcmod\/","name":"Python MC Mod - Minecraft","isPartOf":{"@id":"https:\/\/vpesports.com\/minecraft\/#website"},"primaryImageOfPage":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/pythonmcmod\/#primaryimage"},"image":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/pythonmcmod\/#primaryimage"},"thumbnailUrl":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/pythonmcmod-icon-d37e70c01aeee65cac9d2909d003c7aa4f00351c_96.webp","datePublished":"2026-06-07T11:34:38+00:00","breadcrumb":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/pythonmcmod\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vpesports.com\/minecraft\/mods\/pythonmcmod\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vpesports.com\/minecraft\/mods\/pythonmcmod\/#primaryimage","url":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/pythonmcmod-icon-d37e70c01aeee65cac9d2909d003c7aa4f00351c_96.webp","contentUrl":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/pythonmcmod-icon-d37e70c01aeee65cac9d2909d003c7aa4f00351c_96.webp","width":96,"height":96},{"@type":"BreadcrumbList","@id":"https:\/\/vpesports.com\/minecraft\/mods\/pythonmcmod\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vpesports.com\/minecraft\/"},{"@type":"ListItem","position":2,"name":"Mods","item":"https:\/\/vpesports.com\/minecraft\/mods\/"},{"@type":"ListItem","position":3,"name":"Python MC Mod"}]},{"@type":"WebSite","@id":"https:\/\/vpesports.com\/minecraft\/#website","url":"https:\/\/vpesports.com\/minecraft\/","name":"Minecraft","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vpesports.com\/minecraft\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod\/127208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod"}],"about":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/types\/mod"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/media\/127209"}],"wp:attachment":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/media?parent=127208"}],"wp:term":[{"taxonomy":"mod_category","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod_category?post=127208"},{"taxonomy":"mod_loader","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod_loader?post=127208"},{"taxonomy":"minecraft_version","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/minecraft_version?post=127208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}