Custom item behavior? Within a regular addon? Yes, this is possible! I, solvedDev, am developing this technique for almost five months now. The whole trick is to not edit the item behavior but make the player entity react to certain items held. This process isn't that simple and can get quite challenging to write - That's why I made a free generator for you to use! solvedDev's Item Generator applies item behaviors written in an easy-to-learn JSON syntax on any entity selected.
Creator: solvedDev
Did you ever want to create an addon like the Astronomic Expansion Addon?
I decided that I want to make it easier to customize item behavior and created a generator for it. You won't get around writing JSON, but it's still a massive improvement in simplicity. You don't believe that?
Here's an example why even I am using it: The More Potions Addon has 1200 lines of code in the player.json! I would normally need to type these by hand. With my generator, I only had to write 222 lines of JSON. Additionally, I can rely on the generated JSON being fully functional so that I don't need to spend hours fixing bugs anymore.
But the greatest advantage is that one has easy access to custom consumable items - a brand new technique developed by solvedDev.
Read more about the generator and how to use it here: github.com/solvedDev/Item-Generator
Examples
A basic example for a custom JSON which the generator reads & converts into a JSON format Minecraft can read.
{ "project": { "name": "exampleName", "prefix": "example" }, "items": [ { "name": "emerald_sword", "item_replacement": "wooden_hoe", "activation_domain": "hand", "focus_behavior": { "consumable": false }, "on_use": { "add_components": { "minecraft:attack": { "damage": 9 } } } } ] }
An example of an addon which used solvedDev's Item Generator: More Potions Addon
Feel free to ask any further questions on how to use my generator!