Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-184177

/clear, /fill, and /testforblock commands interpret certain parameters in an unexpected and problematic way

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.21.20.22 Preview, 1.21.2 Hotfix, 1.21.30, 1.21.40.23 Preview
    • None
    • Confirmed
    • Multiple
    • 1268017

      When you use a /clear command to delete Stone from an inventory, it not only deletes Stone but also Granite, Polished Granite, Diorite, Polished Diorite, Andesite, and Polished Andesite. When you use a /fill command to replace Stone, it also replaces these other blocks. And when you use /testforblock to detect Stone, it deletes the other blocks as if they were Stone.

      A similar thing happens when you use these commands on Prismarine: They recognize Prismarine Bricks and Dark Prismarine as if they were Prismarine.

      Steps to reproduce:

      1. Download the attached world "Replace 'stone'.mcworld" and open it.
      2. You are on the first of 3 stations. Note that your hotbar contains stacks of Stone, Granite, Polished Granite, etc.
      3. In front of you is a command block labeled "/clear test". Press the button on it to execute the command /clear @p stone.
      4. Note that all the blocks in your hotbar were cleared.
      5. Move to the next station. Press the button on the command block labeled "/fill test" to execute the command /fill 4 71 2 4 73 5 air replace stone. Note that all the blocks were replaced, not just the Stone blocks.
      6. Move to the next station. Press the button on the command block labeled "/testforblk tst" to execute the command /testforblock 2 71 7 prismarine. Note that the "Successfully found..." message appears in chat, despite the block actually being Dark Prismarine.

      Expected results:
      The commands should only detect/affect the blocks with the specified names, 'stone' and 'prismarine'.

      Observed results:
      The commands detect/affect blocks with additional names. With 'stone', the commands include 'granite', 'polished_granite', 'diorite', 'polished diorite', 'andesite', and 'polished andesite'. With 'prismarine', the commands include 'prismarine_bricks' and 'dark_prismarine'.

      Additional information:
      This problem only affects 'stone' and 'prismarine' in the current retail release 1.21.2 Hotfix. However, in 1.21.20.22 Preview, more blocks are affected:

      • 'anvil' includes 'chipped_anvil', 'damaged_anvil', and presumably 'deprecated_anvil'
      • 'quartz_block' includes 'chiseled_quartz_block', 'quartz_pillar', and 'smooth_quartz'
      • 'red_sandstone' includes 'chiseled_red_sandstone', 'cut_red_sandstone', and 'smooth_red_sandstone'
      • 'dirt' includes 'coarse_dirt'
      • 'sand' includes 'red_sand'
        As more block names get split in future releases, I believe we can also expect at least a few more to be affected:
      • 'purpur_block' will include 'purpur_pillar'
      • 'sandstone' will include 'chiseled_sandstone', 'cut_sandstone', and 'smooth_sandstone'
      • 'sponge' will include 'wet_sponge'

      See my comments below for a discussion of why this problem is happening, why it's probably intended, and why I believe it's going to become a bigger problem if it's left this way.

            Auldrick [MCPE Mod] Auldrick
            Votes:
            4 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              CHK: