use of org.bukkit.entity.Spider in project InfernalMobs by NyaaCat.
the class AbilityWebber method onAttackPlayer.
@Override
public void onAttackPlayer(LivingEntity mobEntity, Mob mob, Player victim, boolean isDirectAttack, EntityDamageByEntityEvent ev) {
if (Helper.possibility(0.7))
return;
boolean webJail = false;
if (mobEntity instanceof Spider && Helper.possibility(0.1))
webJail = true;
Location loc = victim.getLocation();
if (!webJail) {
setWebWithDecay(loc.getBlock(), 60, false);
} else {
for (Block b : Helper.getSphere(loc.getBlock(), 4)) {
setWebWithDecay(b, 30, true);
}
}
}
use of org.bukkit.entity.Spider in project InfernalMobs by NyaaCat.
the class AbilityWebber method onPlayerAttack.
@Override
public void onPlayerAttack(LivingEntity mobEntity, Mob mob, Player attacker, boolean isDirectAttack, EntityDamageByEntityEvent ev) {
if (Helper.possibility(0.7))
return;
boolean webJail = false;
if (mobEntity instanceof Spider && Helper.possibility(0.1))
webJail = true;
Location loc = attacker.getLocation();
if (!webJail) {
setWebWithDecay(loc.getBlock(), 60, false);
} else {
for (Block b : Helper.getSphere(loc.getBlock(), 4)) {
setWebWithDecay(b, 30, true);
}
}
}