Package dev.architectury.hooks.item
Class ItemStackHooks
java.lang.Object
dev.architectury.hooks.item.ItemStackHooks
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
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
-