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

Some mobs won't despawn when switched to peaceful


    • Icon: Bug Bug
    • Resolution: Fixed
    • 20w46a
    • 20w45a
    • None
    • Community Consensus
    • Entities
    • Important

      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

      1. Spawn in a new world with cheats, in peaceful, in survival
      2. Execute these commands for faster testing
        1. /give @p minecraft:spyglass
        2. /give @p minecraft:creeper_spawn_egg 64
        3. /give @p minecraft:ender_pearl 64
        4. /gamerule keepInventory true
        5. /gamerule mobGriefing false
      3. Walk approximately 150 blocks away from spawn (enderpearls to go faster)
      4. Execute /time set midnight
      5. Execute /difficulty hard
      6. Spawn creeper, walk into its explosion, and die (I cannot seem to consistently reproduce this by using /kill)
      7. Quickly execute /difficulty peaceful (the faster you execute it, the more mobs tend to stick around I've found)
      8. Walk the direction of your death (I used the spyglass and hitboxes to better look around)
      9. 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.

            boq [Mojang] Bartosz Bok
            SunnyNoki Noki
            9 Vote for this issue
            5 Start watching this issue