- Make sure your are the administration of the minecraft server.
- Make sure your minecraft server runs under a tmux session.
- Make sure your minecraft has map mod installed.
- Start your server and login on your client.
- Change your gamemode to spectator (or creative) mode.
- Change
PLAYER_NAME
with your player name. - Change
TMUX_SESSION_NAME
with your tmux session name. - Change
SLEEP_DURATION
deepend on your load speed. - Change
VIEW_DISTANCE
to match your server and client settings. - Change
WORLD_SIZE
to set size limit. - Run this script and have a cup of tea.
Last active
August 17, 2024 22:32
-
-
Save aimerneige/d8083c87b043e804cc260bb606b95a9c to your computer and use it in GitHub Desktop.
Minecraft Auto TP / auto load your minecraft map with tp command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
PLAYER_NAME = "Notch" | |
TMUX_SESSION_NAME = "minecraft" | |
SLEEP_DURATION = 6 | |
CHUNK_SIZE = 16 | |
VIEW_DISTANCE = 24 | |
WORLD_SIZE = 4096 | |
TP_STEP = CHUNK_SIZE * VIEW_DISTANCE | |
START_COORDINATE = WORLD_SIZE // 2 | |
xz = [ | |
(x, z) | |
for x in range(-START_COORDINATE, START_COORDINATE, TP_STEP) | |
for z in range(-START_COORDINATE, START_COORDINATE, TP_STEP) | |
] | |
total = len(xz) | |
for i, v in enumerate(xz): | |
x, z = v | |
mc_commands = f"/tp {PLAYER_NAME} {x} ~100 {z}" | |
tmux_commands = f'tmux send-keys -t {TMUX_SESSION_NAME} "{mc_commands}" Enter' | |
print(tmux_commands) | |
os.system(tmux_commands) | |
print(f"{i}/{total} {x}/{z} done. {SLEEP_DURATION*(total-i)//60} minute remaining") | |
time.sleep(SLEEP_DURATION) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment