by Jaffe2718
This project is written for debugging Minecraft commands. In this project, there are serveral subprojects:
fabric
: The mod for Fabric and Quilt, used to be a connection kit for IDE. It can create two socket server to provide code completion and code execution service.ide-debug-tool
: This is a command line tool which can connect to the socket server opened by the mod. It can send code to the server and get the result. It can be a debug tool for IDE or a command line tool to execute *.mcfunction file directly.idea-plugin
: This is a plugin for IntelliJ IDEA. It can connect to the socket server opened by the mod. It provides code completion and code execution service for IDE. The plugin contains a compiled ide-debug-tool
so you don't need to install it manually.Fabric/Quilt Loader
and
or for your Minecraft version.mods
folder.jar
file, you can just download it from and you can use it without any installation steps.File
-> Settings
-> Plugins
-> ⚙️
-> Install Plugin from Disk...
-> choose the downloaded file, or install it directly from JetBrains Marketplace inside IDE.Note: The Author's most recommended way to use this mod is to use the plugin.
Setup a new datapack project in IDEA.
At the welcome page of IDEA, click New Project
;
Choose Minecraft Datapack
;
Fill in the metadata of the datapack project;
Click Create
, and the project will be automatically created with the default structure, and it will create data/<namespace>/functions/demo.mcfunction
as example.
Import an existing datapack as a project.
New Project
;Import Minecraft Datapack
;Note: The plugin will automatically check if the datapack is valid by these rules:
1. The datapack must be a zip file;
2. The zip file must contain apack.mcmeta
file;
3. The zip file must contain adata
folder.
If the datapack is invalid, the plugin will prevent you from importing it.
The plugin will prevent you from importing an invalid datapack
Create
, and the datapack will be automatically imported as a project.
Open or create a project;
Open or create a Minecraft function file;
Start the Minecraft game with the mod installed, and open the world you want to debug;
Start edit the *.mcfunction
file, connect to the socket servers and start debug;
Now you can start edit the *.mcfunction
file and get code completion and code execution service.
You can click Execute Without Log
to execute the command without logging the result to the console.
You can click Execute
to execute the command and log the result to the console.
Note: Remember to configure the project JDK. Click
File
->Project Structure
to choose the JDK you want to use.
Congigure the project JDK
File
-> Settings
-> Editor
-> Color Scheme
-> Minecraft Function
to customize the syntax highlighting.
File
-> Settings
-> Editor
-> Color Scheme
-> Minecraft Function
to customize the syntax highlightingLaunch the Minecraft game with the mod installed, and open the world you want to debug;
Click Tools
-> Minecraft Command DecKit
-> Minecraft Command Console
and fill the host and port of the command execution socket server.
Tools
-> Minecraft Command DecKit
-> Minecraft Command Console
to open the consoleYou can write your commands line by line press Enter
to execute the command.
Enter
to execute the commandThere are two ways to start the task to generate a datapack:
Right click the project view and click Minecraft Command DevKit
-> Generate Minecraft Datapack
in the context menu.
Generate Minecraft Datapack
in the context menuClick Tools
-> Minecraft Command DecKit
-> Generate Minecraft Datapack
from the main menu bar:
Generate Minecraft Datapack
from the main menu barClick Generate
to start the task, and the datapack will be generated in the build
folder of the project named <project_name>.zip
.
Generate
to start the taskTips:
Generate and Import/Link Datapact to Minecraft
are similar toGenerate Minecraft Datapack
, but they require the user to fill in the host and port of theDatapack Management Service
socket server. ForImport
, the generated datapack will be copied to the current world's datapack folder, and forLink
, the generated datapack will be linked to the current world's datapack folder and expired when the world is closed.
There are two ways to start the task to manage the datapack:
Click Tools
-> Minecraft Command DecKit
-> Datapack Management
from the main menu bar:
Manage Datapack
from the main menu barRight click the project view and click Minecraft Command DevKit
-> Datapack Managment
in the context menu.
Manage Datapack
in the context menuInput the host and port of Datapack Management Service
socket server shown in the Minecraft game.
Datapack Management Service
socket serverDo your operations.
Datapacks
-> Status
-> Enabled
and click Disable
to disable the datapack.Datapacks
-> Status
-> Available
and click Enable
to enable the datapack.Datapacks
-> Type
-> Common
and click Import...
to import a datapack.Datapacks
-> Type
-> Common
and click Link...
to link a datapack.Tips:
This feature is with the requirement3.x
version of the mod.
Only the world is opened, theDatapack Management Service
socket server will be valid.
The linked datapack will be expired when the world is closed, and the imported datapack will be copied to the world's datapack folder.
- For more info, please visit DEV.md.
When you use this mod, you should be careful. Because it can execute any command. Do not send the host and port to any untrusted program to avoid being attacked. Do not install this mod on your multiplayer server to avoid being attacked by DDOS or other attacks.
This is the document for developers. We will introduce how to develop external tools to work with this mod. Programing language is not limited, you can use any language you like, the only thing you need to do is make your tool has the ability to connect to the socket server and interact with it.
For 3.x
version, the mod will create 3 socket servers, for code completion, code execution and datapack management.
Server | Type | Description | Accepted Message | Returned Message |
---|---|---|---|---|
Code Completion | Socket Server | The server for code completion | single line command or unfinished command | multiple line result |
Code Execution | Socket Server | The server for command execution in Minecraft | single line command | execution feedbacks |
Datapack Management | Socket Server | The server for receive datapack from client | json string without \n like { "name": "[name].zip", "data": "[base64 encoded data]", "flag": "import" } |
None |
\n
at the end of the message or auto flush the buffer to send the message to the server.For more information, please visit .
This project is licensed under the MIT License.
You can use this project for any purpose for free.
See the file for details.
Currently, this project is still in development.
If you have any idea or suggestion,
please open an issue or pull request.
And the plugin is only for IntelliJ Platform IDEs
,
if you want to use other IDEs such as Eclipse
and VS Code
,
you can create a plugin for it and pull request to this project.
What's more, the mod is only for Fabric
and Quilt
currently,
you can rewrite it for Forge
or other mod loaders and pull request to this project.
I will be very grateful if you can help me to improve this project.