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)

4
  • 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? Jan 15, 2018 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, 2018 at 20:22
  • Nothing with code, in 1.13 you can put recipes in data packs. Jan 15, 2018 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. Jan 15, 2018 at 20:35

3 Answers 3

4

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.

1
  • 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. Sep 11, 2018 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.

2
  • I might have to do that, but I'd rather not, sorry!
    – MINEMortal
    Jan 15, 2018 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! Oct 12, 2018 at 23:27
-2

just do /gamerule doLimitedCrafting true and /clear @a @a

1
  • 1
    Hi there, welcome to Arqade! Could you provide more information on what these commands do, and how they would be useful to the asker?
    – Gigazelle
    Feb 23, 2020 at 5:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .