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

Sniffers store wrong coordinates in sniffer_explored_positions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.20.4, 24w10a, 1.20.5
    • None
    • Plausible
    • Mob behaviour
    • Important
    • Gameplay

      Sniffers use the sniffer_explored_positions list to store the last 20 "sniffed" locations.

      The bug is that the coordinates that are stored are based on where the sniffer is standing, but they are checked against the position of a block where the sniffer's head digs. That means that even if a sniffer is stuck on a block he can continue digging seeds forever.

      Steps

      1. Sniffer (center) is standing on a block (e.g. [0,64,0])
      2. Sniffer digs at location of his head (2.25 from center of body) (e.g. [2,64,0])
      3. Sniffers position is added to sniffer_explored_positions: [[0,64,0]]
      4. After cooldown, sniffer tries to sniff again at the same position of its head [2,64,0], it checks the sniffer_explored_positions list. Since [2,64,0] is not there he is allowed to dig for another seed even though he didn't move at all.
      5. Sniffers position is added to sniffer_explored_positions leading to duplicates. So the list is now [[0,64,0], [0,64,0]]

      This can continue happening forever.

      Expected Results

      The game should store position of the block the sniffer digs rather than the sniffer's position.

            Unassigned Unassigned
            BS-Harou BS-Harou
            Votes:
            4 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              CHK: