With five new Enchantments you can now add potion effects to your target when fighting. Any living entity that gets hit with a sword that has one of these enchantments will be granted the status effect. These Enchantments can be put on swords either from the enchantment table or from being combined with a book of that enchantment. Books can be obtained by enchanting a book on an enchantment table or by trading with villagers. These enchantments are not compatable with eachothe and each enchantment has its own texture for the swords.
Harming I: Targets given Instant Damage I for 10 seconds
Harming II: Targets given Instant Damage II for 20 seconds
Healing I: Targets given Instant Health I for 10 seconds (Damages undead)
Healing II: Targets given Instant Health II for 20 seconds (Damages undead)
Poison I: Targets given Poison I for 10 seconds
Poison II: Targets given Poison II for 20 seconds
Slowness I: Targets given Slowness I for 10 seconds
Slowness II: Targets given Slowness II for 20 seconds
Slowness III: Targets given Slowness III for 30 seconds
Slowness IV: Targets given Slowness IV for 40 seconds
Weakness: Targets given Weakness for 10 seconds
This mod requires the Fabric API.
This is available under the CC0 license. Feel free to learn from it and incorporate it in your own projects.