mojira.dev
MC-265280

Mobs sometimes become invisible when you join a singleplayer world

The bug

If you start playing a singleplayer world, sometimes nearby mobs are invisible. You can hear the mob's sounds and you can hit the mob with snowballs, but you can't hit the mob with a sword. Using F3 + B does not display the mob's hitbox. Querying the mob's active_effects NBT with commands shows that it does not currently have any effects, so it does not have the invisibility effect, even though we can't see the mob. Often the mobs are only briefly invisible and then become visible again, but sometimes they remain invisible indefinitely.

To reproduce

I was not able to reproduce this at all in 1.20.1. In 1.20.2 pre-release 1, in most worlds I could only manage to reproduce the situation where the mobs are only briefly invisible. However, in one specific world, I noticed that a snow golem remained invisible indefinitely if it was invisible when you joined the world.

  1. Download the attached world:

[media]
  1. Join the world in singleplayer.

  2. If the snow golem is visible, repeatedly exit the world and re-join it until the snow golem is invisible. Anecdotally, the snow golem seems to be invisible approximately 50% of the time when this world is joined.

  3. Observe that the snow golem remains invisible no matter how long you wait. ❌

  4. Use the below command to verify that the snow golem does not have the invisibility effect:

    /data get entity @e[type=minecraft:snow_golem,limit=1,sort=nearest] active_effects

    Result: Found no elements matching active_effects

  5. Switch to spectator mode.

  6. Use the below command to spectate the snow golem:

    /spectate @e[type=minecraft:snow_golem,limit=1,sort=nearest]
  7. Observe that you see a glitchy, flashing view of the sky and some other mobs. ❌

Expected behavior

All mobs are always visible unless they have the invisibility effect.

Observed behavior

Sometimes mobs are invisible for no reason.

Video

Warning: This video contains rapid movement that resembles flashing. Consider not watching if you have a medical condition that makes you sensitive to flashing.

[media]

Linked issues

Attachments

Comments 2

I deleted most of the region files in the world before I zipped it so that the zip file would be small enough to upload as an attachment.

Other mobs that I have noticed become invisible after joining a singleplayer world include cows, llamas, skeletons, iron golems, and villagers. I have also noticed that villagers can become invisible when they are cured from a zombie villager into a villager.

pine1needle

(Unassigned)

Confirmed

Platform

Very Important

Entities, Networking

1.20.2 Pre-release 1

1.20.2 Pre-release 2

Retrieved