Topic category: Help with Minecraft modding (Java Edition)
Hey all I'm having a bit of an issue trying to make a procedure for my custom Pickaxe tool so that when it "On Block Destroyed With Tool" it has a 50% chance to copy whatever was mined or destroyed/The player was looking at (whatever is easiest to make) and add it to the players inventory.
For Example:
The Player Mines some "Smooth Stone", and with a 50% chance has Smooth Stone added to their inventory as well as have the Cobblestone you'd get normally from destroying it with a pick. The same applies for Coal, you'd get the 1 unit of coal as per a normal pickaxe with a 50% chance to get an unmined Coal Ore Block in your inventory, same for Diamond, Emerald etc..
Sadly I am not very good with coding in general and cannot find a way to determine what was destroyed by the pick and then have the 50% chance to copy it to the players inventory. I hope someone could be so kind as to suggest a way to do this, sorry if I have not made myself very clear, but maybe someone can advise a way to do this. Thank you!
It’s not that hard tho
It’s very simple u shall try