TransWikia.com

How can I change the recipe to make it Unbreakable?

Arqade Asked by Shiba on July 20, 2021

The code is right there but basically I want to make it where it makes the diamond sword unbreakable and also with a name.

{
    "type": "minecraft:crafting_shaped",
    "pattern": [
        " # ",
        " # ",
        " / "
    ],
    "key": {
        "#": {
            "item": "minecraft:obsidian"
        },
        "/": {
            "item": "minecraft:blaze_rod"
        }
    },
    "result": {
        "item": "minecraft:diamond_sword",
        "count": 1
    }
}

2 Answers

As of the current Minecraft update (1.14.4) it is not possible to add custom NBT to crafting recipes, so you will be unable to give it a custom name and enchantments.

Correct answer by Liam22840 on July 20, 2021

There is a way!

I was searching for a way to do this and I found a creative solution.

You will need an advancement, recipe, and a function.

  • The recipe should not be shapeless, and the recipe should give a knowledge book.
  • The advancement should look like:
{
    "criteria": {
        "Unlocked": {
            "trigger": "minecraft:recipe_unlocked",
            "conditions": {
                "recipe": "RECIPE NAME"
            }
        }
    },
    "rewards": {
        "function": "FUNCTION NAME"
    }
}
  • And the function should look like:
recipe take @s (RECIPE NAME)

advancement revoke @s only (ADVANCEMENT NAME)

(GIVE COMMAND FOR ITEM)

clear @s minecraft:knowledge_book

This has been super useful to me in the past, and it's the only way I know where you can use the vanilla crafting table for custom nbt recipes.
Note: There is no way to require custom nbt crafting materials unless you use a custom crafting table

Answered by Yek on July 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP