http://pastie.org/1794200 Looks like you can only obtain a wolf's target when it's attacking right now. Anyone know of a workaround to get the owner?
Code: getServer().getScheduler().scheduleAsyncRepeatingTask(this, new Runnable() { public void run() { for (final World world : getServer().getWorlds()) { for (final Entity entity : world.getLivingEntities()) { final Location loc = entity.getLocation(); if (Math.abs(loc.getBlockX()) < radius && Math.abs(loc.getBlockZ()) < radius && entity instanceof CraftWolf) { final CraftWolf craftWolf = (CraftWolf) entity; final EntityWolf wolf = (EntityWolf) craftWolf.getHandle(); if (wolf.v().length() > 0 && getServer().getPlayer(wolf.v()) == null) { craftWolf.damage(100); } } } } } }, 1000L, 10000L); I came up with that to kill wolves between 0 and radius (X or Z) with a offline owner to stop my spawn area from piling up wolves and lagging the server. Does it look like it will function properly before I put it on my production server? It passed all the local tests I did. Not sure if I should be using Async or Sync though...