Creating a Random Number of items.

Started by FoggyRoad on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Creating a Random Number of items.

I'm trying to make a Blue Berry Bush and I want it to drop a random amount of Berry's but everything I looked up doesn't explain it, Or I'm just a little dumb lol.

Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Use the math "random(0,1)"…
Thu, 04/02/2020 - 19:24

Use the math "random(0,1)" to give you a random number between 0,1. Use X 10 to make it 1-10, X5 = 1-5 etc.

So you use that with spawn gem (maybe repeat a loop the random number of times) to drop the items

So to drop 5 berries:

Repeat Random(0,1)*5

Spawn gem "Berry"

 

Joined May 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
where is spawn gem ?  
Mon, 05/11/2020 - 19:28

where is spawn gem ?