onEvent('entity.spawned', event => {
  // Normal mobs
  for(let mob of mob_list_iron_armor) {
    if (event.entity.type == mob) { 
        // Get the full NBT of the mob.
        var NBT = event.entity.fullNBT;      
        // Loop all HandItems/ArmorItems and modify all vanilla one:
        // Hands
        for (let h in NBT.HandItems){
          // Check if id is present
          if ('id' in NBT.HandItems[h]){
            if (NBT.HandItems[h].id.match(/minecraft:.*_.*/)){
              NBT.HandItems[h].id = "silentgear:machete";
              NBT.HandItems[h].tag = iron_machete_tag;
        }}};
        // Armor
        for (let h in NBT.ArmorItems){
        // Check if id is present
        if ('id' in NBT.ArmorItems[h]){
          if (NBT.ArmorItems[h].id.match(/minecraft:.*_.*/)){
            NBT.ArmorItems[h].id = armor_id[h];
            NBT.ArmorItems[h].tag = iron_armor_tag[h];
        }}};
      // Set the new NBT.
      event.entity.fullNBT = NBT;
  }};
});