Take the 2-minute tour ×
Arqade is a question and answer site for passionate videogamers on all platforms. It's 100% free, no registration required.

According to the Wiki "Cave Spiders, like regular spiders, are pacified (made neutral) by bright light." But, in my cave spider spawner area, I am lighting regions with redstone lanterns and the cave spiders are definitely not getting passified...enter image description here

Is the wiki just wrong?

share|improve this question

1 Answer 1

up vote 10 down vote accepted

The wiki is technically correct: cave spiders can be pacified by light, just like regular spiders.

If you decompile Minecraft and deobfuscate its source code using Minecraft Coder Pack (MCP), there are two classes, EntitySpider and EntityCaveSpider, which govern the behavior of spiders and cave spiders, respectively.

EntityCaveSpider is subclass of EntitySpider: in layman's terms, this means that unless otherwise specified, cave spiders inherit all the behaviors and properties of regular spiders.

EntitySpider has a method called findPlayerToAttack(): in it, there's a conditional that checks the light level of the area to determine whether it should be hostile:

float f = getBrightness(1.0F);

if (f < 0.5F) {
  double d = 16D;
  return worldObj.getClosestVulnerablePlayerToEntity(this, d);
}
else {
  return null;
}

This method is not overridden in EntityCaveSpider, meaning cave spiders use the same conditional and thus, can be pacified by light like regular spiders can be.

To confirm that cave spiders are indeed passive at high light levels, you can do the following:

  1. Create a new world. Set the Game Mode to Creative and under More world options..., set the World Type to Superflat.
  2. Open the inventory, and add the Spawn Cave Spider egg to your hot bar.
  3. Use the egg to create a bunch of cave spiders.
  4. Open the chat bar by pressing T.
  5. Type the following and press enter:

    /gamemode 0
    

This will set your game to survival mode: if cave spiders weren't pacified, they'd attack you on sight. However, they shouldn't do that:

Cave spiders being all passive and whatnot

The issue is likely that once a mob has found a player to attack, it does not give up the target until it's either killed, the target has left its aggro radius, or it fails a 1:100 roll to drop aggro when light levels are high enough.

share|improve this answer
    
So, in the dungeon spawner scenario, "player is close to spider" "spider only spawns in dark area" once spider spawns, spider targets player. Now that spider has targetted player, unless player gets outside aggro radius (16 right?) nothing will get spider passive. So, while it's possible, for mob farming it's just not practical. Is that a fair summary? –  John Aug 1 '12 at 15:30
1  
@John that's correct: the rules for mob spawner spawning pretty much contradict the rules for spider passivity. –  user3389 Aug 1 '12 at 15:52
    
How fast is the "findPlayerToAttack()" called? Is it called once very tick? Or less frequently? Is there time between spider spawning from a monster spawner to detect the spawn and turn on a lighting system to prevent the spider from targeting the player? –  John Aug 1 '12 at 19:18
1  
@John There's a long chain of methods that govern when it's called, but the end result is that it's called as part of entity creation and on every tick. Depending on how fast your computer is, you probably only have a few milliseconds between entity creation and targeting. –  user3389 Aug 1 '12 at 19:32
    
Hey, how about creating a very well lit area outside of the spawn area? How often is that 1:100 roll performed? Once per tick? That'd be about 5 seconds before a spider went passive. –  John Aug 1 '12 at 21:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.