onEvent('entity.spawned', event => {
    // Wither
    if (event.entity.type == 'minecraft:wither_skeleton') { 
        // 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 = stone_machete_tag;
        }}};
      // Set the new NBT.
      event.entity.fullNBT = NBT;
    };
    // Brute
    if (event.entity.type == 'minecraft:piglin_brute') { 
        // 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:axe";
              NBT.HandItems[h].tag = gold_axe_tag;
        }}};
      // Set the new NBT.
      event.entity.fullNBT = NBT;
    };
    // Vindicator
    if (event.entity.type == 'minecraft:vindicator') { 
        // 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:axe";
              NBT.HandItems[h].tag = iron_axe_tag;
        }}};
      // Set the new NBT.
      event.entity.fullNBT = NBT;
    };

});