-
Notifications
You must be signed in to change notification settings - Fork 0
Making SlowTools
26.1.2 -- v0.3 and beyond
Making Slow Tools is easy! ... But it isn't data-driven, you'll need to implement Slowcraft into your mod.For the time being, use Modrinth Maven to add Slowcraft as a dependency to your project.
The SlowTool Class extends the Item Class, and can be made similarly to creating an Item in Fabric, but instead of registering a new Item, you create a SlowTool and feed it a small config.
Here's a simple example:
public static final SlowTool ITEM_NAME = register("item_name", properties -> new SlowTool(
SlowTool.config()
.itemOutput(Item, int)
.useTime(int)
.usageSound(SoundEvent)
.finishSound(SoundEvent)
.excludeFromJEI,
properties
), new Item.Properties());
| Parameter | Information | Required |
|---|---|---|
| .itemOutput(Item, int) | The Item to give the player when the Craft is finished; int is an optional amount of the Item to give. It can accept up to 4 .itemOutput fields, but requires at least one. | Yes |
| .useTime(int) | The amount of seconds it takes for the item to finish Crafting the Slow Tool | Yes |
| .usageSound(SoundEvent) | The sound to play incrementally as the player holds right click (Crafts). Default SoundEvent is SoundEvents.BRUSH_GENERIC | No |
| .finishSound(SoundEvent) | The sound to play when the player finishes the Craft. Default SoundEvent is SoundEvents.BUBBLE_POP | No |
| .excludeFromJEI | Excludes this Slowtool from being added to the JEI Progressive Crafting recipe category; does nothing if JEI is not installed. | No |
Note: As of 0.4, Slowtools may only have at most 4 .itemOutput's
SlowTools only require two parameters: the Item to give the player, and the amount of time it takes to finish it. A SlowTool can be as simple as:
In this example, we create the "rubbing_sticks" Item exactly like registering an Item in Fabric, but instead of registering an Item we register a SlowTool and feed it the config:
.itemOutput(Items.IRON_INGOT) // Says to give the player a Diamond when finished
.useTime(30), // Says it'll take 30 seconds to complete
The constructor will assume default values for parameters not provided, as explained in the table above
SlowTools have more functionality, however, here's an example of a SlowTool using more parameters:
.itemOutput(Items.IRON_INGOT, 8) // Says to give 8 Iron Ingots
.itemOutput(Items.STICK, 2) // Second item output
.itemOutput(Items.DIAMOND) // Third item output, constructor assumes to give only 1
.itemUses(50)
.usageSound(SoundEvents.UI_LOOM_SELECT_PATTERN) // Says to play this sound incrementally as the player uses the item
.finishSound(SoundEvents.FIRECHARGE_USE) // Says to play this sound sound when the player finishes
Otherwise, SlowTools can be manipulated in a similar manner to Items
Note: When creating a recipe for a SlowTool, do not include damage or max_damage values. Those are determined by the SlowTool item registration above.
26.1.2 -- v0.2
Making Slow Tools is easy! ... But it isn't data-driven, you'll need to implement Slowcraft into your mod.
For the time being, use Modrinth Maven to add Slowcraft as a dependency to your project.
The SlowTool Class extends the Item Class, and can be made similarly to creating an Item in Fabric, but instead of registering a new Item, you create a SlowTool and feed it a small config.
Here's a simple example:
public static final Item ITEM_NAME = register("item_name", properties -> new SlowTool(
SlowTool.config()
.itemOutput(Item, int)
.itemUses(int)
.usageSound(SoundEvent)
.finishSound(SoundEvent)
.returnItem(Item, int),
properties
), new Item.Properties());
| Parameter | Information | Required |
|---|---|---|
| .itemOutput(Item, int) | The Item to give the player when the Craft is finished; int is an optional amount of the Item to give | Yes |
| .itemUses(int) | The amount of uses it takes for the item to finish Crafting. Slow Tools progress at a rate of tps % 5, about 4 times per second, so an itemUses of 240 will require 60 seconds to finish | Yes |
| .usageSound(SoundEvent) | The sound to play incrementally as the player holds right click (Crafts). Default SoundEvent is SoundEvents.BRUSH_GENERIC | No |
| .finishSound(SoundEvent) | The sound to play when the player finishes the Craft. Default SoundEvent is SoundEvents.BUBBLE_POP | No |
| .returnItem(Item, int) | An optional item to give to the player as well when the item is finished. Intended to be used to return tools when finished; int is an optional amount of the item to return to the player | No |
SlowTools only require two parameters: the Item to give the player, and the amount of uses (time) it takes to finish it. A SlowTool can be as simple as:
In this example, we create the "rubbing_sticks" Item exactly like registering an Item in Fabric, but instead of registering an Item we register a SlowTool and feed it the config:
.itemOutput(Items.DIAMOND) // Says to give the player a Diamond when finished
.itemUses(50), // Says it'll take 50 'uses' to complete -- roughly 12 seconds
The constructor will assume default values for parameters not provided, as explained in the table above
SlowTools have more functionality, however, here's an example of a SlowTool using all possible parameters:
.itemOutput(Items.DIAMOND, 8) // Says to give 8 Diamonds to the player when finished
.itemUses(50)
.usageSound(SoundEvents.SAND_HIT) // Says to play the SAND_HIT sound incrementally as the player uses the item
.finishSound(SoundEvents.CRAFTER_CRAFT) // Says to play the CRAFTER_CRAFT sound when the player finishes
.returnItem(Items.STICK, 2), // Says to additionally give the player 2 sticks when finished
Otherwise, SlowTools can be manipulated in a similar manner to Items
Note: When creating a recipe for a SlowTool, do not include damage or max_damage values. Those are determined by the SlowTool item registration above.
1.21.1 -- v0.1 (Old)
This version of the mod is oldMinecraft version: 1.21.1
Making Slow Tools is easy! ... But it isn't data-driven, you'll need to implement Slowcraft into your mod.
For the time being, use Modrinth Maven to add Slowcraft as a dependency to your project.
The SlowTool Class extends ToolItem, so making a new one is as easy as making a typical ToolItem plus a few extra constructor parameters and one component in the item's recipe.
Here's an example of a Slow Tool Class:
- Parameter 1 is the output of the craft as
ItemConvertibleviaitemOutput - Parameter 2 is the maximum durability of the item (how long it will take to craft) as
intviaitemUses. Slow Tools progress at a rate oftps % 5, about 4 times per second, so anitemUsesof 240 will require 60 seconds to finish. - Parameter 3 is the sound played as the player crafts the item as
SoundEventviausageSound - Parameter 4 is the sound played when the craft is finished as
SoundEventviafinishSound - Parameter 5 is the typical
Item.Settings()section, where standard item settings can be applied
Additionally, when constructing the recipe for Slow Tools, they require a component of minecraft:damage set to the same value as their itemUses (durability). The easiest way to do this is to simply add the component to the recipe's JSON, set to the same value:
!The minecraft:damage value must be the same as your item's itemUses (Parameter 2 above)!
If you're generating your recipes via code, you'll have to add the component to your output.
Drawbacks?
- Slow Tools require a Material to function, hard-set to SlowMaterial in the SlowTool Class constructor
- Requires manually setting the damage component through recipe definition

