@Override public void run() { for (Pet cosmetic : this.module.getParent().getApi().getAllCosmetics(Pet.class)) { Creature entity = cosmetic.getEntity(); Player p = cosmetic.getPlayer(); if (!entity.getWorld().getName().equalsIgnoreCase(p.getWorld().getName()) || entity.getLocation().distance(p.getLocation()) >= this.module.getConfig().getTeleportDistance()) { entity.teleport(p); entity.setTarget(p); } } }