Interface RecipeEvents.CraftResult
- Record Components:
player- who is crafting, or null for a crafter blockresult- what the recipe makes (don't change it; interrupt with another stack instead)
- Enclosing class:
RecipeEvents
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A crafting recipe's result was worked out: for the result slot of a crafting grid (the crafting table's, a
player's inventory, or another menu built the same way) whenever its ingredients change, or for a crafter about to
craft. Interrupting with another stack shows and crafts that instead; with
ItemStack.EMPTY, nothing can be
crafted (a crafter fails as it does with no recipe).
RecipeEvents.CRAFT_RESULT.register((player, recipe, input, result) ->
isLocked(player, recipe) ? EventResultHolder.interrupt(ItemStack.EMPTY) : EventResultHolder.pass());
-
Method Summary
Modifier and TypeMethodDescriptionEventResultHolder<net.minecraft.world.item.ItemStack> onCraftResult(@Nullable net.minecraft.world.entity.player.Player player, net.minecraft.world.item.crafting.RecipeHolder<?> recipe, net.minecraft.world.item.crafting.CraftingInput input, net.minecraft.world.item.ItemStack result)
-
Method Details
-
onCraftResult
EventResultHolder<net.minecraft.world.item.ItemStack> onCraftResult(@Nullable @Nullable net.minecraft.world.entity.player.Player player, net.minecraft.world.item.crafting.RecipeHolder<?> recipe, net.minecraft.world.item.crafting.CraftingInput input, net.minecraft.world.item.ItemStack result)
-