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

Visual desync when NoGravity armour stands are pushed by shulkers


    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.15.2, 20w19a, 20w20b, 20w21a, 20w22a, 1.16 Pre-release 2, 1.16 Pre-release 3, 1.16 Pre-release 5, 1.16 Pre-release 6, 1.16 Pre-release 7, 1.16 Release Candidate 1, 1.16, 1.16.1, 20w27a, 20w28a, 20w29a, 20w30a, 1.16.2 Pre-release 1, 1.16.2 Pre-release 2, 1.16.2 Pre-release 3, 1.16.2 Release Candidate 1, 1.16.2 Release Candidate 2, 1.16.2, 1.16.3 Release Candidate 1, 1.16.3, 1.16.4 Pre-release 1, 1.16.4 Pre-release 2, 1.16.4, 20w45a, 20w46a, 20w48a, 20w49a, 20w51a, 21w03a, 1.16.5, 21w05a, 21w05b, 21w06a, 21w08b, 21w14a, 21w15a, 21w16a, 21w17a, 21w18a, 21w19a, 21w20a, 1.17 Pre-release 1, 1.17 Pre-release 4, 1.17, 1.17.1 Pre-release 1, 1.17.1, 21w37a, 21w38a, 21w39a, 21w40a, 21w41a, 21w42a, 21w43a, 1.18 Pre-release 7, 1.18.2, 1.19 Pre-release 1, 1.19, 1.19.1 Pre-release 4, 1.19.1, 1.19.2, 22w43a, 1.19.3, 23w03a, 23w04a, 23w05a, 23w06a, 23w07a, 1.19.4 Pre-release 3, 1.19.4, 23w13a, 23w14a, 1.20 Pre-release 1, 1.20 Pre-release 2, 1.20 Pre-release 4, 1.20.1, 23w31a, 23w32a, 23w33a, 23w35a, 1.20.2 Pre-release 1, 1.20.2 Pre-release 2, 1.20.2, 23w40a, 23w41a, 23w42a, 23w43a, 23w44a, 1.20.4, 24w03b, 24w04a, 24w05a, 24w11a, 24w12a, 1.20.6, 1.21
    • None
    • Confirmed
    • Entities

      The bug

      When a shulker opens its shell into an armour stand with the NoGravity tag, it appears to the client that the armour stand was pushed. Server-side, however, the armour stand doesn't move at all.

      How to reproduce

      1. Spawn a shulker on the ground
      2. Summon an amour stand with the NoGravity tag above the shulker
        /execute at @e[type=shulker,limit=1,sort=nearest] run summon armor_stand ~ ~1 ~ {NoGravity:1}
      3. Wait until the shulker opens its shell slightly
         The armour stand appears to be pushed upwards
        After a moment, the armour stand appears back at its original location

      Expected behaviour

      The armour stand should be pushed both client-side and server-side.

      Code analysis by ampolive

      The shulker doesn't actually pull entities downwards at all (when its top is facing up) , as there is a check to see if the shulker is opening rather than closing when entities are moved in Shulker#onPeekAmountChange. The armor stand is only moved client-side, so it is just a visual desync. This can be checked by running /data get entity @e[type=minecraft:armor_stand,limit=1,sort=nearest] Pos and seeing that the armor stand's Y position never actually changes server-side.

      The shulker only moves entities that have noPhysics set to false; but the armor stand with no gravity has a value of false on the client side and true on the server side. I would assume this is because noPhysics is set to true in ArmorStand#readAdditionalSaveData, but this method seems to only be called server-side. This could be fixed by changing ArmorStand#hasPhysics() to return !this.isMarker() instead of !this.isMarker() && !this.isNoGravity(), or by checking if the entity with noPhysics is not an armor stand with no gravity in Shulker#onPeekAmountChange.

      There is a separate smaller issue with all entities with no gravity being visually pushed upwards slightly more than they should and then snapping back down again, which is probably because the peek values are different on the client and server.

        1. Closed.png
          805 kB
        2. Expected.png
          806 kB
        3. Open.png
          816 kB

            Unassigned Unassigned
            Darth Cobby [Mod] j_p_smith
            10 Vote for this issue
            2 Start watching this issue