I just started taking an interest in creating my own addons, and wanted to do first an axe that would grant a Strength buff for 5 seconds everytime I hit any mob.
I've followed a tutorial for this but AI kept telling me that placing events inside an item is already deprecated. And following what AI told me to do isn't really working for me.
I have tried, calling the event from my axe json.
"minecraft:weapon": {
"on_hit": {
"event": "minecraft:apply_veilbreaker_buff"
}
And defining that event from the player json which is like:
"minecraft:apply_veilbreaker_buff": {
"run_command": {
"command": [
"effect @s strength 5 5"
]
}
}
And I have been reading from bedrock.dev, wiki.bedrock.dev, even the Minecraft section on learn.microsoft but I haven't found anything regarding, "on_hit" component.