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)
3 Answers
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. Commented Sep 11, 2018 at 10:26
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.
-
-
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!– rydwolfCommented Oct 12, 2018 at 23:27
Just do
/gamerule doLimitedCrafting true
and
/clear @a @a
-
1Hi there, welcome to Arqade! Could you provide more information on what these commands do, and how they would be useful to the asker? Commented Feb 23, 2020 at 5:48
/clear @p crafting_table
so that nobody can have crafting tables.