Started by
Super_m
on
Topic category: Advanced modding
I need code for random amount of items dropped from block when it's broken. I tried creating a procedure for that, but after many failed attempts I gave up.
I know there are quite a few forum topics answearing this question, but I think they are all outdated.
If anyone could give me tips or point me out to up-to-date guide I would very much appricate it.
Try to use Repeat function and put inside it Repeat Random 0,1 times
if not than make local variable that will be set to random and place in repeat function block that will take number from this variable
cool idea, only problem is there is no way for me to give item to the player. Maybe there's a way I overlooked?
Use Spawn Gem
that for some reason works twice
Probably make it so that the block itself doesn't break into anything (or breaks into air) in the block properties if you're also going to use the Spawn Gem event.
You have to override quantityDropped, set you max and min amount of drops and use the rand function
My type of code (the way my mod's code was before the rewriting) somehow just spammed the player's inventory with diamonds for no reason, well unless the reason is moving a few blocks at all, that might be it, because that's exactly what it seems like to me in-game!