The Bug
Switching to peaceful sometimes leaves hostile mobs behind. They have their hitboxes, but cannot be pushed, and instead pushing you. They do not move nor react to the player (even in survival). Switching to hard difficulty and back to peaceful does nothing to them. Exiting the world and entering back gets rid of them.
To Reproduce
Spawn in a new world with cheats, in peaceful, in survival
Execute these commands for faster testing
/give @p minecraft:spyglass
/give @p minecraft:creeper_spawn_egg 64
/give @p minecraft:ender_pearl 64
/gamerule keepInventory true
/gamerule mobGriefing false
Walk approximately 150 blocks away from spawn (enderpearls to go faster)
Execute /time set midnight
Execute /difficulty hard
Spawn creeper, walk into its explosion, and die (I cannot seem to consistently reproduce this by using /kill)
Quickly execute /difficulty peaceful (the faster you execute it, the more mobs tend to stick around I've found)
Walk the direction of your death (I used the spyglass and hitboxes to better look around)
❌ Hostile mobs are still around despite the difficulty being peaceful
My guess is something to do with the quick movement of the player and despawn/spawn spheres.
Linked issues
is duplicated by 4
Attachments
Comments 2
Similar problem. Opened a creative snapshot world. Switched from creative to survival a few times to test the shulkers spawning feature—shulkers could be killed/de spawned normally. Increased the random tick speed to 1000 to watch amethyst crystals grow. Then doused myself with a splash potion of night vision and switched to spectator to look for amethyst geodes. When I found a geode cave there were 4 creepers and 3 skeletons just standing there. Still had the ‘breathing’ animation but couldn’t be punched and didn’t react to me when I switched to survival.
Unable reproduce for me