This mod can make everything throwable, with a configuration system.
If you want to make something throwable, add to #throwable:throwable item tag.
Sometimes you may not want to throw when offhand has item (such as shield), configurable in
#throwable:disable_when_offhand tag.
By default, all swords can be thrown. Once you have thrown, you need to click it to pick up.
Create file .minecraft/config/throwable.json (may exist).
{
//Whether only owner can pick up the throwable thing.
"ownerPickUpOnly": false,
//Whether auto pickup when near.
"autoPick": false,
//Whether become an item entity when despawn
"dropWhenDespawn": true,
//Ticks before despawn, -1 for infinite time (not recommended)
"despawnDelayTicks": 6000,
//Whether need to sneak to throw
"sneakThrow": true
}Create file data/<item namespace>/throwable/throwable/<item id>.json, then write following contents:
{
//All keys are optional, following are default values
//Use time to grant critical damage
"maxUseTime": 72000,
//Damage Ratio to item base damage
"damageScale": 0.5,
//Initial throw speed; higher values also increase damage
"throwSpeed": 2.5,
//Render Size Scale
"scale": 1,
//Rotate based on renders in item frame
"rotateOffset": 0,
//Sound played when item thrown
"throwSound": "minecraft:item.trident.throw",
//Sound played when hit ground
"hitGroundSound": "minecraft:item.trident.hit_ground"
}