Random Drops

Started by Newbie23 on Sat, 11/21/2015 - 02:06

Topic category: Help with MCreator modding

Last seen on 06:57, 23. Nov 2015
Joined Nov 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Random Drops
Sat, 11/21/2015 - 02:06

Hello,
I didn't find any example on the Wiki, so i want to ask you. Is there a way to let a block (when mined) drop a random value of Items? Like a Redstone Ore.

Thanks for answers,

Newbie23.

The easiest way how to make
Sat, 11/21/2015 - 09:30

The easiest way how to make random amount of drop is:

View source of your block. On the end is this line:
 

public int quantityDropped(Random par1Random){
return 1;
}

}

 

And there the return 1; change to return 1 +(int)(Math.random()*7);

The 1 is minimal amount of drop.

The 7 is maximal amout drop - minimal drop so in this example is maximal drop 8.

Last seen on 08:47, 17. Oct 2019
Joined Aug 2018
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
custom code snippet or…
Wed, 09/04/2019 - 12:00

custom code snippet or procedure??