跳到主要内容

Discovery Codex Recipe Category

Defines a discovery codex recipe category

Manifest entry describing a recipe category displayed in the discovery codex.

字段

字段类型默认值描述
categoryString—Unique identifier for this recipe category
titleString—Title displayed at the top of the recipe category inventory占位符
rowsInt6Number of rows for the recipe category inventory (1-6)
orderInt0Display order when listing recipe categories
iconItem—Icon used when referencing this recipe category
iconNameString?—Optional custom name for the category icon in menus. Placeholders: {unlocked}, {total}占位符
iconLoreList<String>emptyOptional lore lines for the category icon. Placeholders: {unlocked}, {total}占位符多行
lockedIconLoreList<String>emptyLore to display for the icon when the recipe category is locked占位符多行
backgroundItem?—Optional background filler item for the recipe category inventory
itemSlotRangeString—Range of slots where recipe entries will be displayed (e.g. '1-25')
startSlotInt0Slot index where recipe entries start (0-based)
fillByRowBooleantrueIf true, recipe entries fill row by row; otherwise column by column
previousButtonItem?—Item used for the previous page button in the recipe category inventory
previousButtonSlotInt0Slot for the previous page button
previousButtonNameString?—Custom name for the previous page button占位符
previousButtonLoreList<String>emptyLore for the previous page button占位符多行
nextButtonItem?—Item used for the next page button in the recipe category inventory
nextButtonSlotInt8Slot for the next page button
nextButtonNameString?—Custom name for the next page button占位符
nextButtonLoreList<String>emptyLore for the next page button占位符多行
backButtonItem?—Item used for the back button in the recipe category inventory
backButtonSlotInt44Slot for the back button (default: 44)
backButtonNameString?—Custom name for the back button占位符
backButtonLoreList<String>emptyLore for the back button占位符多行
parentCategoryString?—Optional parent category identifier
guiLayoutCodexGuiLayoutPAGINATEDGUI layout type for the recipe category menu可选值:PAGINATEDSCROLLABLEFRAMESIMPLE
onUnlockTriggersList<Ref<TriggerableEntry>>emptyTriggers to fire when this recipe category is unlocked by a player
itemsList<RecipeItemConfig>emptyRecipes contained within this category
RecipeItemConfig(16)
字段类型默认值描述
entryIdString—Unique identifier for this recipe entry
recipeKeyString—Minecraft recipe key (NamespacedKey, e.g. 'minecraft:iron_pickaxe')
itemItem—Icon displayed when the recipe is unlocked
lockedItemItem?—Icon displayed when the recipe is locked
lockedLoreList<String>emptyLore displayed while the recipe is locked占位符多行
unlockedLoreList<String>emptyLore displayed when the recipe is unlocked占位符多行
criteriaList<Criteria>emptyCriteria that unlock the recipe
menuStationSlotInt?—Optional override for the crafting station slot in the detailed recipe menu
menuStationItemItem?—Optional override of the crafting station item for this recipe
menuStationNameString?—Custom name applied to the crafting station item for this recipe占位符
menuStationLoreList<String>emptyLore applied to the crafting station item for this recipe占位符多行
menuIndicatorButtonItem?—Optional indicator button displayed in the detailed recipe menu for this recipe
menuIndicatorButtonSlotsList<Int>emptySlots (0-based) where the indicator button will be placed for this recipe
menuIndicatorButtonNameString?—Custom name applied to the indicator button for this recipe占位符
menuIndicatorButtonLoreList<String>emptyLore applied to the indicator button for this recipe占位符多行
onUnlockTriggersList<Ref<TriggerableEntry>>emptyTriggers to fire when this specific recipe is unlocked by a player
menuTitleString—Title of the detailed recipe menu displayed when viewing a recipe占位符
menuRowsInt4Number of inventory rows for the detailed recipe menu (1-6)
menuBackgroundItem?—Background filler item for the detailed recipe menu
resultSlotInt24Slot index (0-based) used to display the crafted result
craftingGridSlotsList<Int>—Slots used for the 3x3 crafting grid (must contain 9 entries)
menuBackButtonItem?—Optional back button item for the detailed recipe menu
menuBackButtonSlotInt31Slot index (0-based) for the detailed recipe back button
menuBackButtonNameString?—Custom name for the detailed recipe back button占位符
menuBackButtonLoreList<String>emptyLore applied to the detailed recipe back button占位符多行
menuStationSlotInt-1Slot index (0-based) used to display the crafting station for the recipe; set to -1 to disable
menuStationItemItem?—Item shown as the crafting station. Empty = the workstation of the recipe type (crafting table, furnace, smoker, campfire, stonecutter, smithing table)
menuStationNameString?—Custom name applied to the crafting station item占位符
menuStationLoreList<String>emptyLore applied to the crafting station item占位符多行
menuIndicatorButtonItem?—Optional indicator button displayed in the detailed recipe menu
menuIndicatorButtonSlotsList<Int>emptySlots (0-based) where the indicator button will be placed
menuIndicatorButtonNameString?—Custom name applied to the indicator button占位符
menuIndicatorButtonLoreList<String>emptyLore applied to the indicator button占位符多行
TypeWriter 通用字段(criteria)
字段类型默认值描述
criteriaList<Criteria>emptyDefault criteria that unlock recipes in this category

How to use it​

Each recipe in items has an entryId and a recipeKey, the namespaced key of a recipe registered on the server (for example minecraft:iron_pickaxe). Clicking an unlocked recipe opens the detail view: the ingredients in craftingGridSlots (nine slots by default) and the result in resultSlot. Shaped, shapeless, furnace-type, stonecutting and smithing recipes are supported.

Recipe criteria fall back to the category criteria when empty. Link the category to a parent with parentCategory, or put the recipe's entryId in a normal category item to open the recipe from there.

The menuStation* and menuIndicator* fields decorate the detail view of a recipe:

  • Crafting station — menuStationSlot (-1, the default, disables it), menuStationName and menuStationLore. The item is menuStationItem; when it is empty, the workstation of the recipe type is shown (crafting table, furnace, blast furnace, smoker, campfire, stonecutter or smithing table).
  • Indicator — menuIndicatorButton placed in menuIndicatorButtonSlots, with menuIndicatorButtonName and menuIndicatorButtonLore.

Each recipe in items has the same fields, and a value set on the recipe wins over the one of the category. A station slot of -1 on a recipe disables the station decor for that recipe.