@minecraft/server
    Preparing search index...

    Class RecipeCraftingContextBeta

    Provides access to the slots and recipe of a players active crafting UI ie. stonecutter.

    Index

    Properties

    inputSlotCount: number

    The amount of addressable input slots for getInputItem and setInputItem.

    This property can throw when used.

    minecraftcommon.EngineError

    isValid: boolean

    Whether this recipe crafting context is valid. Invalidates when the player closes the crafting UI or leaves.

    validRecipes: string[]

    The identifiers of the recipes that are valid for the current input items.

    This property can throw when used.

    minecraftcommon.EngineError

    Methods

    • Beta

      Parameters

      • slot: number

        The zero-based input slot index.

      Returns ItemStack | undefined

      The item stack in the input slot, or undefined if the slot is empty.

      Gets the item in the provided input slot.

      This function can throw errors.

      minecraftcommon.ArgumentOutOfBoundsError

      minecraftcommon.EngineError

    • Beta

      Returns ItemStack | undefined

      The output item stack, or undefined if there is no output.

      Gets the item produced by the currently selected recipe.

      This function can throw errors.

      minecraftcommon.ArgumentOutOfBoundsError

      minecraftcommon.EngineError

    • Beta

      Parameters

      • slot: number

        The zero-based input slot index.

      • Optionalitem: ItemStack

        The item stack to place in the slot, or undefined to clear the slot.

      Returns void

      Sets or clears an item in an input slot.

      no-restricted-execution - This function can't be called in restricted-execution mode.

      This function can throw errors.

      minecraftcommon.ArgumentOutOfBoundsError

      minecraftcommon.EngineError

    • Beta

      Parameters

      • recipeId: string

        The identifier of a valid recipe to select.

      Returns void

      Selects a recipe for the current crafting operation.

      no-restricted-execution - This function can't be called in restricted-execution mode.

      This function can throw errors.

      minecraftcommon.EngineError

      InvalidRecipeError