Need help with a simple curse and a complicated enchantment
I am going to warn you that I am on an outdated version for the purposes of continuing to make mods for 1.19.2
First thing I need help with is a curse that makes a message appear in the chat randomly called The curse of yapping. The way I think this is going to work is that procedure-wise on a player tick update it would check for if the tool has the curse on it and then generate a random number which then if that number was a specific number it would say something in chat
Now that sounds easy however as of current I'm yielding no results which leads me to the problem of thinking that I don't know how to make it generate a random number. So if this solution is how I think it is going to work then how do I make it actually generate a random number
The second thing I'm having issues with is an actual enchantment which I've made less progress on. I would like to have an overlay display whenever a tool with the enchantment is being held but currently it's constantly there and I don't know how to make it only appear when a tool with that enchantment is out
On to the actual thing it does. Now it's pretty simple, would just do random extra damage on attack however it's the theme that messes me up, gambling/slot machine. The overlay I mentioned looks like a slot machine and whenever you attack somebody with it it would hypothetically display which number it generated. I know how to do that doing extra damage part however I don't know how to make those three individual random numbers display on the overlay so any help would be nice.thanks.