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

"/execute if block" doesn't print block id of compared block

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 18w06a, 1.15.2, 20w08a, 20w51a, 21w03a, 1.16.5, 21w05b, 21w06a, 21w07a, 21w08b, 1.17, 1.17.1, 1.19, 22w24a, 1.19.3, 1.21.4
    • Confirmed
    • Commands

      The bug

      The title may not be the most accurate description, or imply the best way to fix this. Here's my motivation:

      In 1.12.2, you were able to print the block id and data value of a certain block into chat by using /testforblock with a different block id, and then with a different data value, on it. This was very useful for investigating client/server desync bugs (or features...), and I'm sure there are other use cases. The 1.13 equivalent of /testforblock, /execute if block, doesn't print such feedback into chat anymore.

      To fix this issue, /execute if block could be given some appropriate chat output. If this is deemed to not be in the spirit of /execute, I suggest adding block id and block state output to /data get block.

      Reproduction steps

      1. Place a snow layer at your location
        /setblock ~ ~ ~ snow[layers=1]
        
      2. Use /execute if block
        /execute if block ~ ~ ~ snow[layers=5]
        

        It only says "Test failed", expected would be something like: "Test failed, found minecraft:snow[layers=1] instead of the expected block" (possibly also including the expected block and coordinates)

        1. MC-124973.mp4
          2.67 MB
        2. MC-124973.png
          MC-124973.png
          713 kB

            Unassigned Unassigned
            sof sofia
            Votes:
            11 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              CHK: