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

Arrows can change metadata for any block

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Duplicate
    • Affects Version/s: Minecraft 1.7.5, Minecraft 14w11b
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      OS X 10.9
    • Confirmation Status:
      Unconfirmed

      Description

      Using the technique demonstrated in the attached video, you can update the metadata for any block. The tl;dr of why is because the arrow is trying to update a block's metadata, such as a pressure plate, button, or string, but is at a different x/y/z area and thus updates the wrong block.

      A fix for this is described here:

      FYI: I've explored and tinkered with the 1.7.2 source code.

      This is the same bug in the code that causes arrows to fall out of walls at low power, play their sound twice, tnt drill bedrock, etc.

      Server owners: I made a Forge coremod to fix it a while back, and this fix applies to this device as well: http://www.minecraftforum.net/topic/2480773-forge-172spmplan-bugfixmod-022-various-annoyances-fixed-snowballs-in-smp/

      Potential Mojangstas reading:
      Super simple tweak to fix all of these pesky arrow issues. In EntityArrow's onUpdate() or whatever is called every tick, there is an else block in which the sound "random.bowhit" is called. In that else block, the fourth statement down, a field of type Block (inTile?) is assigned the value of some local variable. This is wrong (was correct in 1.6.4 and someone derped in refactoring I guess). The assignment to inTile needs to be similar to the fifth statement just below, in which the world is called with a set of coordinates to retrieve the Block at that location. See MCP example below. I created a coremod with Minecraft Forge to inject this change and verified that this bug was completely fixed (restored 1.6.4's arrow behavior).

      MCP Names: the statement "this.field_145790_g = var16;" needs to be changed to
      "this.field_145790_g = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f);"

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              ezekielelin [Mod] Ezekiel (ezfe)
              Votes:
              3 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: