跳到正文

Minescript

作者:maxuser

Python scripting for Minecraft

收藏

截图

介绍

中文介绍正在准备中,下面暂时显示原文。

Minescript is a platform for controlling and interacting with Minecraft using scripts written in the Python programming language.

Before using Minescript, please review the Terms of Use.

Join the Minescript Discord Server for announcements and to engage with the Minescript community.

Check out Minescript documentation for details about commands and APIs.

Download Python scripts developed for use with Minescript.

Setup

  1. Download and install the Minescript mod for either Fabric (requires Fabric API) or Forge.
  1. Download and install Python 3 if you don’t already have it: https://www.python.org/downloads/ (or from the Microsoft Store on Windows)
  1. Run Minecraft with the Minescript mod installed. The first time the Minescript mod runs, it will automatically create a minescript folder inside the minecraft folder.
  1. Create Python scripts in the minescript folder.
  1. Run Python scripts from the Minecraft in-game chat by entering backslash (“\\”) followed by the script name without the “.py” extension.

Minescript expects Python to be installed at the following location:

  • on Windows: %userprofile%\AppData\Local\Microsoft\WindowsApps\python3.exe
  • on Mac, Linux, etc: /usr/bin/python3

If Python is installed somewhere else on your system, you can point Minescript at it by changing the python variable in the file config.txt in the minescript folder.

Example

See this example script that demonstrates how to access the player’s coordinates, read blocks at a given location, and create blocks like signs with custom text all from a Python script.

Compatibility
Tested on the following platforms:

  • Fabric, Forge, and NeoForge mod loaders
  • Python 3.7 through 3.10
  • macOS up to Sonoma
  • Linux (Pop!_OS, NixOS, Bazzite, and SteamOS)
  • Windows 10 and 11 (x86)

常见问题

Minescript 支持哪些 Minecraft 版本?

Minescript 支持 Minecraft Java 版 1.18.2–26.3,共 23 个版本,可用的加载器:Fabric / Forge / NeoForge。下载时注意选择和你游戏版本一致的文件。

Minescript 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric / Forge / NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:仅客户端。

评论

登录后评论和评分