I wanted to create a combat knife that a soldier could use to melee or throw at enemies, with the ability to recover it from enemies after throwing. Giving it 1 ammo and using spawnItem to create a copy of the item on impact worked exactly as I wanted, right up until I tested the melee attack and realized that every melee hit also spawned a new knife. This behavior would also stop someone from adding any kind of 'gun bash' melee attack to a flare launcher or similar.
My suggestion is a meleeSpawnItemChance which defaults to -1 aka "use spawnItemChance value" but if set to 0-100 overwrites spawnItemChance when using melee attacks.
- type: STR_COMBAT_KNIFE
[...]
spawnItem: STR_COMBAT_KNIFE
spawnItemChance: 100
meleeSpawnItemChance: 0
[...]