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

LeashKnot Location Selectors are Incorrect

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 15w49b, Minecraft 15w50a, Minecraft 15w51b, Minecraft 16w03a, Minecraft 16w04a, Minecraft 16w05a, Minecraft 16w05b, Minecraft 16w06a, Minecraft 16w07a, Minecraft 16w07b, Minecraft 1.9 Pre-Release 1, Minecraft 1.9 Pre-Release 2, Minecraft 1.9 Pre-Release 3, Minecraft 1.9 Pre-Release 4, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 1, Minecraft 1.9.1 Pre-Release 2, Minecraft 1.9.1 Pre-Release 3, Minecraft 1.9.1, Minecraft 1.9.2, Minecraft 1.9.4, Minecraft 16w21a, Minecraft 1.10 Pre-Release 2, Minecraft 1.10, Minecraft 16w39c, Minecraft 1.11, Minecraft 1.11.2, Minecraft 17w15a, Minecraft 17w16a, Minecraft 1.12 Pre-Release 2, Minecraft 1.12, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 17w48a, Minecraft 17w49b, Minecraft 1.13.2, Minecraft 18w50a, Minecraft 1.14 Pre-Release 3, 1.15 Pre-Release 2, 1.15 Pre-release 4, 1.16.4 Release Candidate 1, 1.16.4
    • None
    • Community Consensus
    • Commands
    • Normal
    • Platform

      I summoned a leash knot, walked into it and tested for it in a small radius, however it failed to show up. Testing it at a much larger radius, it does end up showing up. Using execute at it to summon an entity results in the entity appearing in the correct place as expected, and only the location selectors like radius or x y z dx dy dz on the leash knot seems to be incorrect. The nbt data of the leash knot shows the same location as it is visually as well.

      It appears that if the knot is at 0 180 0, the location where it will search for it is 0 90 0. If you search for a leash knot at 0 180 0, the minimum radius will be the same as the y value so 180. If you search for a leash knot at 0 90 0, the minimum radius will be half the y value so 90. Any radii under 90 cannot find the knot anywhere in the world.

      From Skylinerw - "The search area is being chopped up into a quarter of what it's supposed to be. See the attached image...The location of the Leash knot is correctly centered, but we're only seeing the result of a quarter of the search area, giving the illusion that the coordinates are incorrect."

      To test:

      1. Summon a leash knot. Summon it on a fence to keep it in existence.
      2. Walk up to it and run
        /execute if entity @e[type=leash_knot,distance=..5]
        
      3. Keep increasing the radius until you can find it again. This radius should correspond with the knot's y value. Use the radius you found, and drop down half that distance and then check in that exact spot for a leash knot in half the radius you found. Decreasing the radius below that will no longer yield results no matter where in the world you are.
      4. Run /data get on the leash knot to check the return feedback and notice that the position in its tags is still in fact correct to its actual location.
      5. Run an execute command to, for example, summon an entity at it or say the entity that is in a radius of 2 from it on the leash knot to see that it does indeed run from the correct location.

      My results:

      Leash knot location: 0 60 0

      Leash knot data:

      {Motion:[0:0.0d,1:0.0d,2:0.0d],FallDistance:0.0f,UUIDMost:-1629746060546258151L,Pos:[0:0.5d,1:60.5d,2:0.5d],UUIDLeast:-6959631846312418399L,Fire:0s,Invulnerable:0b,Air:0s,OnGround:0b,Dimension:0,PortalCooldown:0,Rotation:[0:0.0f,1:0.0f]}
      

      First radius searchable while standing at 0 60 0: 60

      /testfor @e[type=LeashKnot,r=60]
      

      I determined that the position it was finding must be under y=60, however checking down below vertically from the leash_knot with different radius yielded ever more confusing results. r=60 only returned results while I was between y=0 and y=60, but not below y=0 nor above y=60. Checking r=30, I found it only detectable when I was at EXACTLY y=30. I could not get any results below r=30. It seems that radius check is scaled by half on the y axis and it thinks the knot is at y=30 and when you are at 0 30 0, it runs the r=30 as if it was checking r=0.

      Code analysis

      The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta.

      The reason for this is very likely that the method net.minecraft.entity.EntityLeashKnot.updateBoundingBox() which overrides the method of its parent class does not set the bounding box but only sets the position. Because of this, summoned LeashKnot s have their bounding box at 0|0|0.

            Unassigned Unassigned
            onnowhere Onnowhere
            Votes:
            22 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              CHK: