Started by
Matt The Banana
on
Topic category: Help with Minecraft modding (Java Edition)
How do I make it so that if an item is crafted with different items than another recipe, it has a different nbt tag? I want to make an item that has feature that when it is crafted with a different flower, it gives a different potion effect. Like 1.14's suspicious stew.
Currently, Mcreator doesn't really seem to support nbt very much (without custom code). Instead, just make a bunch of different items that give different effects.
Oh. I already found out how to do this with code. Thanks for the help though.
can you give me the code please?
Matt The Banana can you make the code open source please? I've spent around 2 days trying to figure this out.
Oh my god. I just figured out how to do this. I know I may be a few years late, but to anybody who wants to do this too, here you go:
So, basically, to make a suspicious stew-like crafting recipe, you have to add NBT tags to the crafted item.
To do that, you have to first make a recipe, and lock the code.
After that, scroll down until you find the "result" part of the code.
Then under the "count: 1," add another line, which says "nbt":
Then you have to type "{\"CustomTag\":\"tag name here\"}". This will apply a NBT tag to the item that is crafted.
In the end, it should look something like this:
{
"type": "minecraft:crafting_shapeless",
"category": "misc",
"ingredients": [
{
"item": "minecraft:cooked_beef"
},
{
"item": "minecraft:glowstone_dust"
}
],
"result": {
"item": "minecraft:cooked_beef",
"count": 1,
"nbt": "{\"CustomTag\":\"regen\"}"
}
}
After that, make a procedure for "Player finishes using item", and make it check for the itemstack's NBT tag, if the NBT tag is the custom tag, it will apply an effect to the player.
I hope this helped.
If you need a more detailed explanation, I posted a forum on this: https://mcreator.net/forum/109084/how-give-crafted-item-nbt-tag
Hey, I found a Page that can help!