Help with code for random number of items dropped from a block

Started by Super_m on Sun, 09/16/2018 - 22:56

Topic category: Advanced modding

Last seen on 22:02, 17. Nov 2018
Joined Aug 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Help with code for random number of items dropped from a block
Sun, 09/16/2018 - 22:56

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.

Last seen on 23:03, 17. Nov 2018
Joined Apr 2014
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
Try to use Repeat function…
Mon, 09/17/2018 - 15:14

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

 

Last seen on 22:02, 17. Nov 2018
Joined Aug 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
cool idea, only problem is…
Mon, 09/17/2018 - 15:21

cool idea, only problem is there is no way for me to give item to the player. Maybe there's a way I overlooked?

Last seen on 23:03, 17. Nov 2018
Joined Apr 2014
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
Use Spawn Gem
Mon, 09/17/2018 - 16:43

Use Spawn Gem

Last seen on 22:02, 17. Nov 2018
Joined Aug 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
that for some reason works…
Mon, 09/17/2018 - 20:48

that for some reason works twice

Last seen on 18:24, 24. Sep 2018
Joined Sep 2018
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Probably make it so that the…
Wed, 09/19/2018 - 05:04

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.

Last seen on 19:27, 18. Oct 2018
Joined Aug 2014
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
You have to override…
Sun, 10/14/2018 - 15:21

You have to override quantityDropped, set you max and min amount of drops and use the rand function