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

Book line15 still runs clickEvents and hoverEvents, despite itself being invisible

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.19.2, 1.19.3, 23w06a, 1.19.4, 1.20.1
    • None
    • Confirmed
    • UI
    • Low
    • Platform

      The bug

      A written book is still rendering the hoverEvents and clickEvents of the 15th line of a page, eventhough the text of such line is not visible.

      How to reproduce

      1. Place a command block to bypass chat length limitation
      2. Copy and paste this command into it (don't worry about the multi-line formatting):
        /give @p minecraft:written_book{title:"Doesn't Matter",author:"Doesn't matter either",pages:['[
        	"1\\n",
        	"2\\n",
        	"3\\n",
        	"4\\n",
        	"5\\n",
        	"6\\n",
        	"7\\n",
        	"8\\n",
        	"9\\n",
        	"10\\n",
        	"11\\n",
        	"12\\n",
        	"13\\n",
        	"14\\n",
        	{
        		"text":"15",
        		"hoverEvent":{
        			"action":"show_text","contents":"Can you see this?"
        		},
        		"clickEvent":{
        			"action":"run_command","value":"/tellraw @p \\"you clicked!\\""
        		}
        	}
        ]']}
        
      3. Activate the command block (e.g. redstone block)
      4. Open the book and hover over the blank area below the printed "14"
        Notice the hover and click of the invisible "15" still work

      Expected behaviour

      If only 14 lines are supported, the 15th line would not render any text nor allow any events to occur

      Actual behaviour

      Any additional lines beyond 14 can still run events.

            Unassigned Unassigned
            Jack_McKalling [Helper] Jack McKalling
            Votes:
            4 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              CHK: