How to make a block drop a random item

Started by LordUnstoppable on

Topic category: Help with MCreator software

Joined Dec 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a block drop a random item
Mon, 12/05/2016 - 14:14 (edited)

Hello,

I would like to make one block that drops a random item.

I have already tried to create that block, but I always end having a block that drops always the same item.

 

Please help me.

Edited by LordUnstoppable on Mon, 12/05/2016 - 14:14
Joined Dec 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Add an event result in "When
Wed, 12/14/2016 - 16:08

Add an event result in "When Block destroyed by Player" in the events tab on the left is somewhere an "Spawn Gem" event click on it. Then click on the gray square and choose the item. You see the word "(in all cases)", too. click on the arrow right next to the word.

Then you need to find "randomPossibility[50%]". You can change the 50% of course! You have a Possibility to change it from 0% to 100%. When you are finished click on the"Add Event" button. If you are making more "When Block destroyed by Player" events that have a random Possibility to drop an item you have a "Lucky Block" like Block! But you have to choose an item that will be dropped every time because if you won't the Application says "you need a block/an item that has to drop every time.".

Joined Oct 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can you add an amount that
Sun, 10/15/2017 - 10:42

Can you add an amount that the item drops?

Joined Dec 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is there still a way to do…
Sat, 01/19/2019 - 18:35

Is there still a way to do this with the newest version of MCreator?

Joined Jan 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
thats what i wan to know
Sun, 02/17/2019 - 17:26

thats what i wan to know

Joined Apr 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If random 0,1 = 0.2 "which…
Sun, 02/17/2019 - 18:38

If random 0,1 = 0.2 "which is 20%"

Do spawn gem 

Joined Apr 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hell Wes, can you elaborate…
Tue, 06/04/2019 - 01:34

Hell Wes, can you elaborate. I do not see how adding a variable and a single number can change anything. Could you send a screen shot of your Element Editor

Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
no that's with 1 % if random…
Tue, 06/04/2019 - 06:00

no that's with 1 %

if random 0,1 < 20 it's 20%

Joined Dec 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
im doing something similar…
Mon, 06/10/2019 - 00:22

im doing something similar but as a crafting table giving you a random item  when placing my custom item in the crafting slots 

Joined Dec 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
also its a custom table  
Mon, 06/10/2019 - 00:23

also its a custom table

 

Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
using premade choises is…
Thu, 01/06/2022 - 18:17

using premade choises is really easy with an if statement but I want to make it so it can get any item in the game how do I do that ?

maybe even items from other mods without defying what items it can drop