Started by
Guillesahu07
on
Topic category: Help with MCreator software
Hi. I am making a mod I am doing leaves for a tree. How can I make it so that when I break them there is a chance that you get a sapling or the fruit I added? Also please tell me how to make the leaves properties like getting the block with shears and breaking themselves if there are no nearby logs. Thank you.
you need simple procedures
Ok, if they are simple explain them to me or put a photo please.
Something like this should work:
https://drive.google.com/file/d/1HXqzbH5FPvUVmtWz7ERHTU9TPalJiJhJ/view?usp=sharing
When a block is broken, check if its the block you want, and if so cancel the event so that the natural block drop doesn't get dropped. Then, remove the block anyways, and randomly spawn an item to be the new drop. In this example I give dirt a 10% chance to drop grass and otherwise it drops dirt, but you could easily change this to be any other items and any other percentage. I also check if the player who broke the block is in not in creative, but that's optional.