Example #1
0
 @Override
 public void onSpawn() {
   npc.getInventory()
       .setItemInHand(new ItemStack(weapons[this.random.nextInt(weapons.length)], 1));
   this.health = Settings.getInt("EvilHealth");
   super.onSpawn();
 }
Example #2
0
 @Override
 public void doTick() {
   if (isTame) return;
   EntityHuman closest = getClosestPlayer(this.range);
   if (!hasTarget() && closest != null) {
     if (!PermissionManager.hasPermission(
         (Player) closest.getBukkitEntity(), "citizens.evils.immune")) {
       targetClosestPlayer(true, this.range);
     }
   }
   super.doTick();
 }