Class HoeItemHooks

java.lang.Object
dev.architectury.hooks.item.tool.HoeItemHooks

public final class HoeItemHooks extends Object
  • 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 block
      predicate - context predicate
      action - action to run