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

Knowledge book gives recipe before removing itself from inventory causing unexpected advancement behavior

XMLWordPrintable

    • Confirmed

      The bug

      Using a knowledge book gives the player the recipes first and then removes itself from the inventory of the player. This creates some problems if an advancement has a trigger for the gives recipes. For example trying to change the item in the slot the knowledge book was in fails because the knowledge book clears this slot afterwards.

      How to reproduce

      1. Download the attached advancement recipe_test.json and place it in the following directory of your world folder
        data\advancements\custom
        
      2. Open the world
      3. Take the anvil recipe
        /recipe take @s anvil
        
      4. Give yourself a knowledge book containing the anvil recipe
        /give @s knowledge_book 1 0 {Recipes:[anvil]}
        
      5. Switch to Survival or Adventure mode
      6. Right click the knowledge book
        → It prints in the chat that you have a knowledge book meaning that when the test happens the knowledge book has not been removed yet

            Excited Maria Lemón
            Mondemen Mondemen
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: