Items
"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
.
INFO
crafting tables are automatically added to the items registry.
Create Item
- Create a MCFUNCTION file in your datapack called
items.mcfunction
. This file can be located anywhere in your datapack. - Now using the NBT Schema and examples from below you can add all your items to the created items.mcfunction.
- You now need to create a function tag located
<pack>/data/rcore/tags/functions/register_items.json
and enter the path to your items function. - Now in-game run
/reload
to reload your datapack. Then run/function rcore:reload
to reload all items
Item 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 |
Refrance in a recipe
To use the registered item in a recipe replace the id in the recipe with the custom ID
mcfunction
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"}}
snbt
{
tags: [
"crafting_table",
"rcore"
],
id: "example:my_recipe",
type: "shapeless",
ingredients: [
{
id: "minecraft:cobblestone"
},
{
id: "minecraft:stick"
}
],
result: {
id: "example:my_item"
}
}