Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-263639

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

XMLWordPrintable

    • Confirmed
    • Commands
    • Normal
    • Platform

      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"]}

        1. MC-263639.zip
          2 kB
        2. MC-263639.mp4
          6.63 MB
        3. 2023-06-18_11.02.45.png
          2023-06-18_11.02.45.png
          237 kB

            Unassigned Unassigned
            SilentPaltos SilentPaltos
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              CHK: