Mojira Archive
MC-263639

/recipe command doesn't work properly when executed from advancement reward function

I used recipe and advancement to add new item:

(RECIPE) recipe.json:

{
    "type": "crafting_shaped",
    "pattern": [
      "###",
      "###",
      "###"
    ],
    "key": {
      "#": {
        "item": "knowledge_book"
      }
    },
    "result": {
      "item": "command_block"
    },
    "show_notification":"false"
  }   

(ADVANCEMENT) used_book.json:

{
  "criteria": {
    "requirement": {
      "trigger": "recipe_unlocked",
      "conditions": {
        "recipe": "recipe"
      }
    }
  },
  "rewards": {
    "function": "used_book"
  }
}
 

(FUNCTION) used_book.mcfunction:

# Take all recipes. Now you can easily find broken recipe
recipe take @s *
advancement revoke @s only used_book
advancement revoke @s from recipes/root 

After using Knowledge Book Recipe is still in the recipe book.
After re-joining world recipe is no more in the recipe book

It also breaks all recipes after next steps
1. Enter command: /recipe give @s *
2. Use book
3. Open recipe book(recipes still here)
4. Re-join
5. Recipes are no more in the book(Only Crafting Table is still here, but it's not issue)

(FUNCTION) give_book.mcfunction

give @s knowledge_book{Recipes:["recipe"]}

Unresolved

SilentPaltos

2023-06-18, 08:26 AM

2024-08-29, 12:43 PM

3

2

Confirmed

Normal

Platform

Commands

advancement-reward, recipe-book, recipes

1.20.1, 1.20.4, 1.21, 1.21.1

-