Skip to content

ading2210/mcutils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

mcutils

A collection of utilities for interacting with Minecraft servers.

Documentation

extractor.py

A tool to extract the client jar file.

from utils import extractor

#extract the client jar file
print("Downloading and extracting the client...")
extractor_obj = extractor.Extractor("1.16.5")
extracted_path = extractor_obj.extract_jar()
print("Client extracted to:", extracted_path)

#get a list of death messages
death_messages = extractor_obj.get_death_messages()

rcon.py

Interface with the Minecraft RCON protocol.

from utils import rcon

#send a command to the local server

rcon = rcon.RCON("127.0.0.1", 25575, "password")

#returns a string with the command's output
output = rcon.send_cmd("list")
print(output)

rcon.close()

query.py

Interface with the Minecraft query protocol.

from utils import query

#query the local server

query_obj = query.Query(("127.0.0.1", 25565))

#retuns a dict with some stats
full_stat = query_obj.full_stat()
basic_stat = query_obj.basic_stat()

print(full_stat)

ping.py

Ping any Minecraft server above version 1.7.

from utils import ping

#ping the local server

pinger = ping.Pinger(("127.0.0.1", 25565))

#retuns a dict with some stats
stats = pinger.ping()

print(stats)

motd_renderer.py

Generate a nearly pixel-perfect image of what a server would look line in the client's server list. You need to have Pillow installed for this to work (pip3 install Pillow).

from utils import motd_renderer

#renders an image of the server's motd and icon

renderer = motd_renderer.MOTDRenderer()

#returns a PIL image object
image = renderer.get_full_image(title="Hypixel", address=("mc.hypixel.net", 25565))
image.save("/tmp/img.png", "PNG")

Generated image:

example of a generated image

About

A collection of utilities for interacting with Minecraft servers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages