How far can mobs see?

How far can mobs see?

I know if I have my render distance set to far then I can see mobs before they see me. Does anyone know precisely how far a mob can see?

  • How to test for time of day with command block in Minecraft
  • Make tools indestructible in Minecraft
  • Nether portals exiting into a different location
  • How far should I place torches in a planar huge room?
  • How can I teleport to an unloaded entity?
  • Why won't my nether portal bring me back where I left?
  • This would be really nice to know since I could simply make sure there is water around my island that goes further than mobs can see.

  • How can I make a random number generator with command blocks in Minecraft?
  • Can monsters naturally spawn on blocks covered by pressure plate?
  • What can I do to secure my towns/castles/hovels from climbing spiders?
  • How can I pump a large lake of lava?
  • How can I find the “center” of a dungeon?
  • Recover a minecraft seed
  • 3 Solutions collect form web for “How far can mobs see?”

    Here is the relevant piece of code from the Minecraft source:

    EntityPlayer entityplayer = worldObj.getClosestPlayerToEntity(this, 16D);
            if(entityplayer != null && canEntityBeSeen(entityplayer))
    

    This means that the range of sight is 16 blocks; however, there’s also something funny. For one, if there is a closer player than you, but they can’t be seen (for example, if the closer player is behind a wall), then the mob won’t notice you.

    Additionally, the ghast uses a separate method including:

    worldObj.getClosestPlayerToEntity(this, 100D);
    

    So it will see you 100 blocks away.

    This isn’t the best evidence I’ve ever dragged from the interwebs, but here is what my searching on the minecraft forums has found.

    Mobs seem to have an awareness extending 16 blocks.

    I never did find this factoid spelled out specifically but I did find these posts referencing it:

    From the numerous threads I’ve been reading (and my own experience) the mobs also don’t rely on sight. So if you are digging in a tunnel next to a hostile cave the mob knows you are there.

    All have 16 blocks line of sight, except the Enderman, which has 64 blocks, and Ghasts, this time 100.

    We love Playing Games, especially Video Games.