function replaceItem(event, oldItem, newItem) {
  var slot = event.player.inventory.find(oldItem);
  if (event.getItem() === oldItem) {
    event.player.inventory.clear(oldItem);
    event.player.inventory.insert(slot, newItem, false);
  }
}

onEvent('player.inventory.changed', event => {
  replaceItem(event, Item.of('woot:mobshard', '{Mob:{keyTag:"",keyEntity:"eanimod:enhanced_chicken"},Kills:5}'), Item.of('woot:mobshard', '{Mob:{keyTag:"",keyEntity:"minecraft:chicken"},Kills:5}'));
  replaceItem(event, Item.of('woot:mobshard', '{Mob:{keyTag:"",keyEntity:"eanimod:enhanced_cow"},Kills:5}'), Item.of('woot:mobshard', '{Mob:{keyTag:"",keyEntity:"minecraft:cow"},Kills:5}'));
  replaceItem(event, Item.of('woot:mobshard', '{Mob:{keyTag:"",keyEntity:"eanimod:enhanced_llama"},Kills:5}'), Item.of('woot:mobshard', '{Mob:{keyTag:"",keyEntity:"minecraft:llama"},Kills:5}'));
  replaceItem(event, Item.of('woot:mobshard', '{Mob:{keyTag:"",keyEntity:"eanimod:enhanced_mooshroom"},Kills:5}'), Item.of('woot:mobshard', '{Mob:{keyTag:"",keyEntity:"minecraft:mooshroom"},Kills:5}'));
  replaceItem(event, Item.of('woot:mobshard', '{Mob:{keyTag:"",keyEntity:"eanimod:enhanced_pig"},Kills:5}'), Item.of('woot:mobshard', '{Mob:{keyTag:"",keyEntity:"minecraft:pig"},Kills:5}'));
  replaceItem(event, Item.of('woot:mobshard', '{Mob:{keyTag:"",keyEntity:"eanimod:enhanced_rabbit"},Kills:5}'), Item.of('woot:mobshard', '{Mob:{keyTag:"",keyEntity:"minecraft:rabbit"},Kills:5}'));
  replaceItem(event, Item.of('woot:mobshard', '{Mob:{keyTag:"",keyEntity:"eanimod:enhanced_sheep"},Kills:5}'), Item.of('woot:mobshard', '{Mob:{keyTag:"",keyEntity:"minecraft:sheep"},Kills:5}'));
  replaceItem(event, Item.of('woot:mobshard', '{Mob:{keyTag:"",keyEntity:"eanimod:enhanced_horse"},Kills:5}'), Item.of('woot:mobshard', '{Mob:{keyTag:"",keyEntity:"minecraft:horse"},Kills:5}'));
});