private Runnable handlePetKill(long time, UUID victimUUID, Tameable tameable) { if (!tameable.isTamed()) { return null; } AnimalTamer owner = tameable.getOwner(); if (!(owner instanceof Player)) { return null; } String name; try { name = tameable.getType().name(); } catch (NoSuchMethodError oldVersionNoTypesError) { // getType introduced in 1.9 name = tameable.getClass().getSimpleName(); } return victimUUID != null ? new PlayerKillProcessor(owner.getUniqueId(), time, victimUUID, new EntityNameFormatter().apply(name)) : new MobKillProcessor(owner.getUniqueId()); }