1

At the moment, I am making a map and eventually I want the player to only craft a certain item and disable them from crafting anything else possible. If I can't find a solution, I'll just make a villager to trade the crafting items. Please help! (I think you can somehow do this with knowledge books but I don't know how if that is the case)

  • Are you in 1.13? There it's possible by overwriting Vanilla recipes with your own recipes or just with nothing. But you would have to rewrite all your commands. Do you want a 1.13 solution? – Fabian Röling Jan 15 '18 at 8:54
  • I'm in 1.12.2 and I don't want to mess with the game's code, I just want to use commands. – MINEMortal Jan 15 '18 at 20:22
  • Nothing with code, in 1.13 you can put recipes in data packs. – Fabian Röling Jan 15 '18 at 20:33
  • If you don't want to use 1.13, then villagers are probably actually the best way to do it. And constantly run /clear @p crafting_table so that nobody can have crafting tables. – Fabian Röling Jan 15 '18 at 20:35
3

You can set the gamerule doLimitedCrafting:

/gamerule doLimitedCrafting true

That prevents everyone from crafting anything for which they haven't unlocked the recipe yet.
To allow them everything by default, do this:

/recipe give @a *

Then take away all the recipes you want to become impossible:

/recipe take @a <name>

with <name> being the recipe's name, which you can easily get with autocomplete.

  • I completely rewrote your answer, I hope you're ok with that. If not, just edit it. It's now a complete solution with commands and explanation instead of just a rough idea. – Fabian Röling Sep 11 '18 at 10:26
0

You might be able to /testfor the items you want to disable in the player's inventory, /clear them, then /give back the items that were used to make it. I'm 90% sure it's possible.

  • I might have to do that, but I'd rather not, sorry! – MINEMortal Jan 15 '18 at 20:23
  • Consider this: Player needs gold block to complete mission. When player gets gold block, it is decrafted into gold ingots, and then into nuggets. Now, the challenge is broken. Nice idea, though! – Redwolf Programs Oct 12 '18 at 23:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.