#tags on custom items

1 messages · Page 1 of 1 (latest)

lethal cedar
#

(sorry for my bad English)

Hi, I’m want to know how I can put a tag on a custom item, I made a recipe w a custom model data and custom components (it’s a bread w custom nutrition and saturation) but every time I’m calling the cmd I have to re make the components (nutricion & saturation)

There’s a method that allows me to call the custom items whit out having to write the components again?

dreamy narwhalBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

🙇 After a while, hit the Summon Helpers button to ping the helper team. They'll be happy to help you

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

fair night
#

Hi, what version of Minecraft are you using? I know for Minecraft 1.21, I think it is the following nbt:

{components:{custom_data:{name_of_tag}}}

If you were to use an item modifier, it is a bit different. Remember the JSON format. It has the tag keyword in custom data holding the tag. Something like “custom_data”:{“tag”:{some_tag}}

I am not in a place where I can validate any of this. I just pulled this from my head. I could be wrong, but it is something like that. In older versions, I believe the components and custom_data nbt are not a thing.

pearl hinge
#

From what I understood, you want it to have the custom data when crafing?

lethal cedar
#

ignore the custom tag, im just triying to doit xd

pearl hinge
#

could you send the recipe in a codeblock?

#
# in this
lethal cedar
#

sorry for the ignorance, how do I do that?

#

{ "type": "minecraft:crafting_shaped", "category": "food", "pattern": [ "aba", " a ", " " ], "key": { "a": { "item": "minecraft:wheat" }, "b": { "item": "minecraft:cooked_porkchop" } }, "result": { "id": "minecraft:cooked_porkchop", "components": { "minecraft:item_name": "[{'text': 'Arepa awuita de sapo'}]", "custom_model_data": 6830003, "custom_data": {"tag":{arepas_default}}, "minecraft:food": { "nutrition": 10, "saturation": 12.8 } } } }

fair night
#

Oh

pearl hinge
#

I'll show you

fair night
#

I know this issue

#

Unless they fixed it recently, you can’t have nbt data in crafting recipes. This means you will have to craft a knowledge book and have an advancement that gives you the custom item. Otherwise, you will need to make a custom crafter.

pearl hinge
#

it is possible in 1.21

fair night
#

Oh, cool

#

I want to know how then 🙂

lethal cedar
#

thats why im triying to tag the item hahaha

pearl hinge
fair night
#

Oh, so custom crafters now support storing data in json?

pearl hinge
#

no

#

that's a normal crafting recipe

lethal cedar
pearl hinge
#

Why do you use a dropper?

tacit raven
lethal cedar
pearl hinge
#

oh, using custom items too.

#

But if you have a custom crafter, you can't use normal recipes.

#

You must create your own way to detect the correct recipes and drop the right item.

lethal cedar
#

yeah, first i run this command to cheek if the correct items are on the dropper

#

execute if block ~ ~ ~ dropper{Items:[{Slot:1b,id:"minecraft:bread",count:1}]} run function template:recipe1

worldly plank
pearl hinge
#

you can use if items to increase performance and make it easier to read.

#

you also have better control over the conditions