Package dev.architectury.hooks.item.tool
Class HoeItemHooks
java.lang.Object
dev.architectury.hooks.item.tool.HoeItemHooks
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addTillable
(net.minecraft.world.level.block.Block input, Predicate<net.minecraft.world.item.context.UseOnContext> predicate, Consumer<net.minecraft.world.item.context.UseOnContext> action) Adds a new tilling (interact with hoe) interaction to the game.
-
Method Details
-
addTillable
public static void addTillable(net.minecraft.world.level.block.Block input, Predicate<net.minecraft.world.item.context.UseOnContext> predicate, Consumer<net.minecraft.world.item.context.UseOnContext> action) Adds a new tilling (interact with hoe) interaction to the game.Tilling uses a predicate/consumer pair system:
- First, the game tests the context using the predicate.
- Then, if the predicate returns
true
, the game will, on the server side only, invoke the action and then damage the hoe item by 1. - Otherwise, no action will be invoked.
- Parameters:
input
- input blockpredicate
- context predicateaction
- action to run
-