HomeJavaModsPythonConnectMod
PythonConnectMod

A simple mod to connect to apps. This mod allows your code to easily interact with your Minecraft client by sending / commands to localhost:2542.

An example in Python:

from socket import socket, AF_INET, SOCK_STREAM

client = socket(AF_INET, SOCK_STREAM)
client.connect(("localhost", 2542))

client.sendall("/give @s minecraft:diamond 64\x00".encode("utf-8"))
# Use \x00 (\u0000, ...) to seperate messages

client.close()
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more