items - lpsmods/lps-recipe-core GitHub Wiki

"items" lets you register custom items with NBT data so you can easily reference them multiple times in recipes

items are stored in rcore:register items.

Create

  1. Create a MCFUNCTION file in your datapack called items.mcfunction. This file can be located anywhere in your datapack.
  2. Now using the NBT Schema and examples from below you can add all your items to the created items.mcfunction.
  3. You now need to create a function tag located data/rcore/tags/functions/register_items.json and enter the path to your items function.
  4. Now in-game run /reload to reload your datapack. Then run /function rcore:reload to reload all items

NBT Schema

Name Type Description Example
id String custom ID of the item. Should be unique between items and shouldn't use the "minecraft" namespace.
type Item Type item - A normal itemloot_table - A loot table item item

Example

Item

data modify storage rcore:register items append value {id: "example:my_item", type: "item", Item: {id: "minecraft:paper", tag: {CustomModelData:5,display:{Name:'{"translate":"item.example.my_item","italic": false}'}} }}

Loot Table Item

data modify storage rcore:register items append value {id: "example:my_loot", type: "loot_table", table: "minecraft:chests/simple_dungeon"}

Refrance in a recipe

To use the registered item in a recipe replace the id in the recipe with the custom ID

data modify storage rcore:register recipes append value {tags: ['crafting_table', 'rcore'], id: "example:my_recipe", type: 'shapeless', ingredients: [{id: "minecraft:cobblestone"}, {id: "minecraft:stick"}], result: {id: "example:my_item"}}

NOTE

crafting tables are automatically added to the items registry.