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

Written book target selectors break when cheats are disabled

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 1.20.2
    • None
    • Unconfirmed
    • (Unassigned)

      When a player in a singleplayer world with cheats enabled runs a command (through a command block or /trigger for consistency) which in any way generates a written book or modifies written book data to contain target selectors (or scores using target selectors), the book works as intended. However if cheats are disabled, the book instead prints the given data directly onto the pages.

      Example command (put this in a command block then enable/disable cheats to confirm):
      give @p written_book{author:"Server",title:"Test",pages:['["",

      {"text":"good day\\n"} {"selector":"@p"}

      ]']}

      I found this while trying to code a custom written book to modify your stats in a datapack. I also tested through regular commands and command blocks and trigger commands in both creative and survival modes with cheats enabled and disabled.

            Unassigned Unassigned
            Snowytags Snowytags
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: