mojira.dev
MC-298077

Multiple datapack recipes with the same pattern always prefer one over the other, even if doLimitedCrafting is enabled

If you create a datapack with two recipes that share a pattern, one will always take precedence when the pattern is dragged into the crafting grid--I assume based on load order. (Both can still be selected from the recipe book and used that way, but once the non-preferred recipe is crafted once, it defaults back to the old recipe, so crafting a stack becomes difficult--arguably a problem in its own right)

The problem is when the doLimitedCrafting gamerule is set to true, and only one recipe is known, there is still a preference. If a player doesn’t know the “preferred“ recipe, dragging the pattern into the crafting grid gives no output and only using the recipe book works--and once the item is crafted once the recipe must be selected again. This is inconvenient and not intuitive.

To Reproduce:

  1. Create and load a datapack with two recipes with the same pattern and not the same result.

  2. Run /gamerule doLimitedCrafting true and /recipe take @p *

  3. Give yourself both recipes.

  4. Create the recipe in the crafting grid, see that it crafts the result of one of them.

  5. Take that recipe away from yourself.

  6. Create the recipe in the crafting grid again, see that it crafts nothing.

  7. Click on the remaining recipe in the recipe book, see that only now it crafts that result

  8. See that after crafting one item, it goes back to crafting nothing until clicked in the book again.

The included .zip contains a datapack that adds two recipes: one for turning Wool blue and another for turning Wool red. It also includes three functions. Each one sets the gamerule, gives you Wool and gives you the associated recipe, disabling all others.

  • recipe_overlap:wizard_both: Blue is always preferred, Red wool can only be crafted from the recipe book one at a time.

  • recipe_overlap:wizard_blue: Works as expected. (This is the preferred recipe)

  • recipe_overlap:wizard_both: Wool can’t be crafted in the grid, Red wool can only be crafted from the recipe book one at a time.

Why would you want to do this?

  • A hypothetical datapack could allow one team to craft 1x Paper into a “Magic Scroll”(Enchanted Book) and another team crafts 1x Paper into “Paper Airplane“(Snowball)

  • Another might replace the Iron Sword recipe with “Poorly-Made Sword“ and later revoke that recipe to replace it with “Expertly-Made Sword“

Both of these could be done by conditionally replacing the item after crafting with functions but would require crafting into some temporary item and be less intuitive, unable to show the correct item in the preview etc.

Linked issues

Attachments

Comments 0

No comments.

Riley F

(Unassigned)

Unconfirmed

(Unassigned)

1.21.5

Retrieved