Vanilla Minecraft datapack. Add customizable guns to the game
1.16.2 - 1.19.3
Put the datapack in the datapacks folder and use /reload to load it. If it does not work, try placing a repeating command block with always active, and enter command /function simpleguns:tick
/give @s minecraft:crossbow{SimpleGuns:{maxBullet:<MaxCanChargeBullet>,bullet:<CurrentChargedBullet>,damage:<DamageOfTheBullet>d,maxChargeTicks:<TimeOfCharging(gt)>,chargeTicks:-1,cooldown:<TimePerShoot>,cooldownTicks:0,recoil:<Recoil(degrees)>,silencer:<Silencer(1b for enable, 0b for disable)>,flameArrester:<FlameArrester(1b for enable, 0b for disable)>},Unbreakable:1b,Enchantments:[{"id":"minecraft:unbreaking",lvl:1}],Charged:1b,HideFlags:255,display:{<PutAnythingHere=]>}}
/give @s minecraft:crossbow{SimpleGuns:{maxBullet:<MaxCanChargeBullet>,bullet:<CurrentChargedBullet>,damage:<DamageOfTheBullet>d,maxChargeTicks:<TimeOfCharging(gt)>,chargeTicks:-1,cooldown:<TimePerShoot>,cooldownTicks:0,recoil:<Recoil(degrees)>,silencer:<Silencer(1b for enable, 0b for disable)>,flameArrester:<FlameArrester(1b for enable, 0b for disable)>,shots:<ShotsEveryFire>,motionRange:<RangeOfRandomOfShotsVelocityOffset>},Unbreakable:1b,Enchantments:[{"id":"minecraft:unbreaking",lvl:1}],Charged:1b,HideFlags:255,display:{<PutAnythingHere=]>}}
You can modify the speed in simpleguns/data/simpleguns/functions/shoot.mcfunction
You can use CustomModelData to customize the texture of the guns. There is an example(the resource pack named customguns). It contains a pistol(CustomModelData:1), a rifle(2) and a shotgun(3).