A Python-based tool for managing KubeJS recipes for Minecraft modding.
KubeJS Recipe Manager is a utility that helps Minecraft modders create, edit, and manage recipes for the KubeJS mod. KubeJS is a popular Minecraft mod that allows players to add custom scripts and recipes to the game using JavaScript.
This tool provides a simple interface for managing these recipes without having to manually edit JS files, making the modding process more accessible and less error-prone.
The application offers two interface modes:
- A graphical user interface (GUI) for a more visual, user-friendly experience (default)
- A command-line interface (CLI) for terminal-based usage
Both modes are available in a single script. The GUI mode is launched by default, and the application will automatically fall back to CLI mode if the GUI cannot be displayed (e.g., if Tkinter is not available).
- Create Recipes: Add new recipes with custom filenames, types, outputs, and ingredients
- Modded Recipes: Create recipes using KubeJS addons from https://kubejs.com/wiki/addons
- Edit Recipes: Modify existing recipes (now with direct editing after creation)
- Delete Recipes: Remove unwanted recipes
- View Recipes: Display all recipes in the collection
- Search Recipes: Find recipes by filename or content
- Export Recipes: Save recipes to a different JS file
The tool supports various KubeJS recipe types, including:
- Shaped crafting
- Shapeless crafting
- Smithing
- Smelting
- And more!
- Python 3.6 or higher
- Tkinter (included in standard Python installation) for the GUI version
-
Clone the repository:
git clone https://github.com/yourusername/KubeJS-Recipe-Manager.git cd KubeJS-Recipe-Manager -
Set up a virtual environment (recommended):
# Create a virtual environment python -m venv .venv # Activate the virtual environment # On Windows: .venv\Scripts\activate # On macOS/Linux: source .venv/bin/activate
-
Install development dependencies (optional):
pip install -r requirements.txt
-
Make the script executable (Unix-like systems):
chmod +x kubejs.py
-
Configuration:
- The application uses a
config.jsonfile to store configuration settings - By default, recipes are stored in
recipes.jsonin the project directory - You can modify settings in the config file to change file paths and other options
- The application uses a
The core application uses only standard library modules, so you don't need to install any external dependencies for basic functionality.
Tkinter is usually included with Python, but some installations might not have it. If you encounter an error like ModuleNotFoundError: No module named '_tkinter', you need to install Tkinter:
- Ubuntu/Debian:
sudo apt-get install python3-tk - Fedora:
sudo dnf install python3-tkinter - macOS with Homebrew:
brew install [email protected](replace 3.x with your Python version) - Windows: Tkinter is included in the standard Python installer from python.org
If you can't install Tkinter, you can still use the CLI mode with the --cli flag.
- Clone or download this repository
- Navigate to the project directory
The application can be run in either command-line interface (CLI) mode or graphical user interface (GUI) mode.
Run the GUI version using Python (default):
python kubejs.pyWhen you run the application in GUI mode, it will:
- Attempt to launch the GUI window
- Ask you if you can see the GUI window
- If you can see it, you can proceed with using the GUI
- If you can't see it, you'll be asked if you want to try again or fall back to CLI mode
This ensures that you can always use the application, even if there are issues with displaying the GUI.
The GUI provides a more user-friendly interface with the following tabs:
- View Recipes: Browse and manage existing recipes
- Add Recipe: Create new recipes with a form interface (now with direct editing after creation)
- Edit Recipe: Modify existing recipes
- Search Recipes: Find recipes by filename or content
If you prefer to use the CLI version, you can run it using Python with the --cli flag:
python kubejs.py --cliFollow the on-screen prompts to manage your recipes.
Recipes are stored in a JS file with the following structure:
{
"recipe_filename": {
"type": "recipe_type",
"output": "output_item",
"ingredients": [
"ingredient1",
"ingredient2",
"..."
]
}
}Here's an example of creating a simple crafting recipe using the command-line interface:
- Run
python kubejs.py --cli - Select option 1 to create a new recipe
- Enter a unique recipe filename (e.g., "diamond_sword")
- When asked if you want to make a normal Minecraft recipe or a modded one, select option 1 for normal
- Enter the recipe type (e.g., "shaped")
- Enter the output item (e.g., "minecraft:diamond_sword")
- Enter the ingredients (e.g., "minecraft:stick,minecraft:diamond")
- The editor will automatically open to allow you to make additional changes
Run the GUI version using Python (default):
# With virtual environment activated
python kubejs.py
# Or directly with the executable (Unix-like systems)
./kubejs.py
# Explicitly specify GUI mode
python kubejs.py --guiWhen you run the application in GUI mode, it will:
- Attempt to launch the GUI window
- Ask you if you can see the GUI window
- If you can see it, you can proceed with using the GUI
- If you can't see it, you'll be asked if you want to try again or fall back to CLI mode
This ensures that you can always use the application, even if there are issues with displaying the GUI.
The GUI provides a more user-friendly interface with the following tabs:
- View Recipes: Browse and manage existing recipes
- Add Recipe: Create new recipes with a form interface (now with direct editing after creation)
- Edit Recipe: Modify existing recipes
- Search Recipes: Find recipes by filename or content
If you prefer to use the CLI version, you can run it using Python with the --cli flag:
# With virtual environment activated
python kubejs.py --cli
# Or directly with the executable (Unix-like systems)
./kubejs.py --cliFollow the on-screen prompts to manage your recipes.
Here's how to create a modded recipe using the graphical interface:
- Run
python kubejs.py(or without any arguments) - Click on the "Add Recipe" tab
- Fill in the recipe details:
- Recipe filename: Enter a unique identifier (e.g., "modded_item")
- Recipe Mode: Select "Modded (KubeJS Addons)"
- Click "Fetch Addons" to retrieve the list of available addons
- Select an addon from the dropdown
- Recipe Type: Select from the dropdown or type (e.g., "custom")
- Output Item: Enter the item ID (e.g., "modpack:special_item")
- Ingredients: Enter comma-separated ingredients (e.g., "minecraft:diamond,minecraft:emerald")
- Click the "Add Recipe" button to save the recipe
- The editor will automatically open the recipe in the Edit tab for further modifications
kubejs.py: The main script that supports both CLI and GUI modesrecipes.json: The file where recipes are stored in JSON formatconfig.json: Configuration file for application settingsrequirements.txt: List of development dependenciesREADME.md: Documentation (this file)
Contributions are welcome! Feel free to submit issues or pull requests.
This project is open source and available under the MIT License.