Class ItemStackHooks

java.lang.Object
dev.architectury.hooks.item.ItemStackHooks

public final class ItemStackHooks extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.world.item.ItemStack
    copyWithCount(net.minecraft.world.item.ItemStack stack, int count)
     
    static net.minecraft.world.item.ItemStack
    getCraftingRemainingItem(net.minecraft.world.item.ItemStack stack)
    Returns the remaining item for a given item stack after crafting.
    static void
    giveItem(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.item.ItemStack stack)
     
    static boolean
    hasCraftingRemainingItem(net.minecraft.world.item.ItemStack stack)
    Returns whether the given item stack has a remaining item after crafting.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • copyWithCount

      public static net.minecraft.world.item.ItemStack copyWithCount(net.minecraft.world.item.ItemStack stack, int count)
    • giveItem

      public static void giveItem(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.item.ItemStack stack)
    • hasCraftingRemainingItem

      public static boolean hasCraftingRemainingItem(net.minecraft.world.item.ItemStack stack)
      Returns whether the given item stack has a remaining item after crafting. This method is stack-aware only on Forge.
      Parameters:
      stack - the item stack
      Returns:
      whether the given item stack has a remaining item after crafting
    • getCraftingRemainingItem

      public static net.minecraft.world.item.ItemStack getCraftingRemainingItem(net.minecraft.world.item.ItemStack stack)
      Returns the remaining item for a given item stack after crafting. This method is stack-aware only on Forge.
      Parameters:
      stack - the item stack
      Returns:
      the remaining item for a given item stack after crafting