Hello Minecraftians/Bukkitters! I'm currently creating a Boss Plugin, and one Boss makes a wolf spawn everytime the boss is attacked, which is supposed to attack a random player. So, I now have this code: Code:java if (e.getEntity() == TheHoundmaster){ LivingEntity entity = (Zombie) TheHoundmaster; if (entity.getHealth() <= 10 + e.getDamage()){ Location[] jails = new Location[] { new Location(hideout, 63, 4.5, 1211), new Location(hideout, 49, 4.5, 1217), new Location(hideout, 49, 4.5, 1211), new Location(hideout, 63, 4.5, 1217) }; Wolf w = (Wolf) hideout.spawnEntity(jails[(int) (Math.random() * 3)], EntityType.WOLF); w.setAngry(true); w.setCustomName("Angry Wolf"); Player random = hideout.getPlayers().get((int) (Math.random() * hideout.getPlayers().size() - 1)); } } How do I make the Wolf attack Player "random"? I already tried .setTarget(random), but the wolf still did nothing. And I tried w.damage(0,random), but from unknown reasons the wolf dies immediately. So, any ideas how to fix it?
Gabum I know there has been issues with this before, but this may be a useful resource to check out: http://forums.bukkit.org/threads/entity-pathfinding-and-targetting.103322/