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

give @s for written book doesn't work as intended

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Awaiting Response
    • None
    • 1.19.2
    • None
    • Unconfirmed
    • (Unassigned)

      Long standing datapack of mine, when a player placed a cauldron, I give them a recipe book by an advancement executing a mcfunction.

      // Some comments here
      public String getFoo()
      {
      tellraw @s ["",{"text":"<Server> ","color":"white"},{"text":"Here is your one free copy of the Cauldron Cookin' recipe book.","color":"green"}]
      
      give @s written_book{pages:["{\"text\":\"\\n\\nCauldron Cookin'\\n\\nby GatKong\\n\\n\\n\\nThe cauldron must have water in it and a fire under it to get it cooking.\"}","[\"\",{\"text\":\"Contents\",\"bold\":true},{\"text\":\"\\n\\n-\",\"color\":\"reset\"},{\"text\":\"Bottle Experience\",\"clickEvent\":{\"action\":\"change_page\",\"value\":3}},{\"text\":\"\\n-\"},{\"text\":\"Freshen Flesh\",\"clickEvent\":{\"action\":\"change_page\",\"value\":4}},{\"text\":\"\\n-\"},{\"text\":\"Identify Stew\",\"clickEvent\":{\"action\":\"change_page\",\"value\":5}},{\"text\":\"\\n-\"},{\"text\":\"Rice Krispy Treats\",\"clickEvent\":{\"action\":\"change_page\",\"value\":6}},{\"text\":\"\\n-\"},{\"text\":\"Snag Enchantment\",\"clickEvent\":{\"action\":\"change_page\",\"value\":7}},{\"text\":\"\\n-\"},{\"text\":\"Spawn Egg\",\"clickEvent\":{\"action\":\"change_page\",\"value\":8}},{\"text\":\"\\n-\"},{\"text\":\"Summon Player\",\"clickEvent\":{\"action\":\"change_page\",\"value\":9}},{\"text\":\"\\n-\"},{\"text\":\"Summon Killer Hare\",\"clickEvent\":{\"action\":\"change_page\",\"value\":10}},{\"text\":\"\\n-\"},{\"text\":\"Summon Rain\",\"clickEvent\":{\"action\":\"change_page\",\"value\":11}}]","[\"\",{\"text\":\"Bottle Experience\",\"color\":\"dark_purple\"},{\"text\":\"\\n\\nbottle o' enchanting\\noxeye daisy\\nsugar\\nblaze powder\\n\\nMakes one Potion of Experience containing 100 experience if you have it, or one Bottle o' Enchanting if you don't.\",\"color\":\"reset\"}]","[\"\",{\"text\":\"Freshen Rotten Flesh\",\"color\":\"dark_purple\"},{\"text\":\"\\n\\npotion of regeneration\\nblock of coal\\nblue orchid\\nrotten flesh\\n\\nMakes one batch up to a stack.\",\"color\":\"reset\"}]","[\"\",{\"text\":\"Identify Suspicious Stew\",\"color\":\"dark_purple\"},{\"text\":\"\\n\\nsuspicious stew\\nsunflower\",\"color\":\"reset\"}]","[\"\",{\"text\":\"Rice Krispy Treats\",\"color\":\"dark_purple\"},{\"text\":\"\\n\\nMelt the butter in a cauldron on medium heat. Add 6 cups Mini Marshmallows, stir until they are completely melted. Add 6 cups of Rice Krispie Cereal and mix. Spoon into a 9×11\\\" pan.\\n\\nAllow to cool.\",\"color\":\"reset\"}]","[\"\",{\"text\":\"Snag Enchantment\",\"color\":\"dark_purple\"},{\"text\":\"\\n\\nbottle o' enchanting\\nbook\\nenchanted item\\nfermented spider eye\\n\\nFull cauldron: extracts all the enchantments from the item.\\n\\nPartial: extracts one enchantment.\",\"color\":\"reset\"}]","[\"\",{\"text\":\"Spawn Egg\",\"color\":\"dark_purple\"},{\"text\":\"\\n\\nmundane potion\\nspawner\\nbone meal\\nspecial ingredient\\n\\nLastly, hold an egg over the cauldron.\\n\\nMakes one spawn egg, type depending on the special ingredient.\",\"color\":\"reset\"}]","[\"\",{\"text\":\"Summon Player\",\"color\":\"dark_purple\"},{\"text\":\"\\n\\npotion of swiftness\\ngolden boots\\nfeather\\nbeetroot seeds\\n\\nThe summoned must be holding a beetroot.\\n\\nDon't hate the player, hate the braam.\",\"color\":\"reset\"}]","[\"\",{\"text\":\"Rabbit of Caerbannog\",\"color\":\"dark_purple\"},{\"text\":\"\\n\\npotion of harming\\nnether wart\\nredstone dust\\none live rabbit\",\"color\":\"reset\"}]","[\"\",{\"text\":\"Summon Rain\",\"color\":\"dark_purple\"},{\"text\":\"\\n\\nwater breathing ptn\\nlily pad\\nwater bucket\\nredstone dust\",\"color\":\"reset\"}]"],title:"Cauldron Cookin'",author:"Margery Moragan",display:{Lore:['{"text":"A cauldron recipe book"}']}}
      
      }
      

      Lately, the player gets the tellraw @s message that they are being given a book, verifying the command is being executed as the intended player, but they don't get the book. The book is dropped at the execution location (in this case the default being the world spawn).

      I was able to get around this by changing the command to be:
      execute at @s run give @s...

            Unassigned Unassigned
            Gatinh0 Scott Miller
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: