-
Notifications
You must be signed in to change notification settings - Fork 0
Data‐Driven‐SlowTools
Data-driven SlowTools let modpack and datapack authors add progressive crafting without writing Java or registering new Minecraft items.
You'll need two files:
- A definition, which tells Slowcraft how the tool looks and behaves.
- A recipe, which tells Minecraft how the player obtains it.
All data-driven SlowTools use Slowcraft's shared template item:
slowcraft:slowtool
The definition attached to that item is what makes each SlowTool different.
Place the definition at:
data/<namespace>/slowcraft/slow_tool/<path>.json
The namespace and filename become the definition/item's ID.
For example:
data/examplemod/slowcraft/slow_tool/string_weaving.json
creates the definition/item ID:
examplemod:string_weaving
You'll use this ID later when creating the recipe.
{
"display": "minecraft:string",
"outputs": [
"minecraft:white_wool",
{
"id": "minecraft:stick",
"count": 2
}
],
"use_time": 30,
"name": {
"text": "String Weaving",
"italic": false
},
"exclude_from_creative": false,
"show_overlay": true
}| Field | Required | Default | What it does |
|---|---|---|---|
display |
Yes | — | Chooses the item texture shown underneath the crafting overlay |
outputs |
Yes | — | Sets the items given to the player when the craft finishes; one to four stacks are allowed |
use_time |
Yes | — | Sets the crafting time in seconds; must be at least 1
|
name |
No | slowtool |
Sets the item's name using a Minecraft text component |
exclude_from_creative |
No | false |
Keeps the SlowTool out of Slowcraft's creative tab |
show_overlay |
No | true |
Controls whether Slowcraft's progressive-crafting overlay is shown |
For a simple display item or output, you can use an item ID:
"minecraft:string"When used as display, the SlowTool will look like minecraft:string with Slowcraft's progressive-crafting overlay drawn above it.
If you only want the display item's texture, you can turn off the overlay:
{
"display": "minecraft:string",
"show_overlay": false
}Outputs can also specify an amount:
{
"id": "minecraft:stick",
"count": 2
}Or include item components:
{
"id": "minecraft:stick",
"components": {
"minecraft:enchantable": {
"value": 10
}
}
}Now that the definition exists, you need a recipe that creates it.
The recipe result should be slowcraft:slowtool, with your definition ID placed in the slowcraft:slow_tool component:
{
"type": "minecraft:crafting_shaped",
"pattern": [
"SS",
"SS"
],
"key": {
"S": "minecraft:string"
},
"result": {
"id": "slowcraft:slowtool",
"components": {
"slowcraft:slow_tool": "examplemod:string_weaving"
}
}
}The definition and recipe are separate so that the same SlowTool can be made by shaped, shapeless, or other component-compatible recipes.
Data-driven SlowTools are added to Slowcraft's creative tab automatically.
If you're adding the item to your own tab, or don't want it visible in Creative Mode, add:
{
"exclude_from_creative": true
}This only hides it from Slowcraft's tab. Recipes and commands will continue to work.
SlowTool definitions are loaded as part of the world's dynamic registry.
After adding, removing, or changing one, restart the world or server. A normal /reload will not load a new definition.
An example Datapack, along with information for it, can be found here.
Slowcraft includes a JSON schema for auto-completion of SlowTool definition .json's
Information on it, and installation instructions, can be found here.
You're done! But Slowcraft includes a few commands which you may find useful: