var countdown = 500;
var Spider = 0;

function useItem(x,y,z,itemId,blockId)
{
if(itemId==337)
{
var stve = Level.spawnMob(x, y + 1, z, 35, "mob/Chica Araña.png");
Entity.setRenderType(stve, 3);
Entity.setHealth(stve, 20);
Spider = 1;
clientMessage(ChatColor.RED + "Chicas Mobs by LuisEg3441 ");
}
}

function modTick()
{
if(Spider==1)
{
countdown--;
var fws = Math.floor ((Math.random() * 15) + 1);
{
if(countdown==0&&fws==1)
{
}
}
}
}

function attackHook(attacker,victim)
{
if(Entity.getEntityTypeId(victim)==11&&Spider==1)
{
Level.playSound(getPlayerX(), getPlayerY(), getPlayerZ(), "random.hurt", 100, 30);
}
}

function deathHook(attacker, victim)
{
if(Entity.getEntityTypeId(victim)==11&&Spider==1)
{
Spider = 0;
}
}


