How to make a block drop a random item

Started by LordUnstoppable on

Topic category: Help with MCreator software

Active 8 years ago
Joined Dec 2016
Points:
704

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 0
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
Active 2 weeks ago
Joined Dec 2016
Points:
760

User statistics:

  • Modifications: 0
  • Forum topics: 7
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 52
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.".

Active 7 years ago
Joined Oct 2017
Points:
688

User statistics:

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

Can you add an amount that the item drops?

Active 6 years ago
Joined Dec 2018
Points:
663

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1
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?

Active 6 years ago
Joined Jan 2015
Points:
719

User statistics:

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

thats what i wan to know

Active 5 months ago
Joined Apr 2014
Points:
1223

User statistics:

  • Modifications: 2
  • Forum topics: 27
  • Wiki pages: 1
  • MCreator plugins: 0
  • Comments: 656
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 

Active 5 years ago
Joined Apr 2019
Points:
660

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1
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

Active 3 years ago
Joined Feb 2018
Points:
820

User statistics:

  • Modifications: 2
  • Forum topics: 10
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 136
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%

Active 1 year ago
Joined Dec 2018
Points:
765

User statistics:

  • Modifications: 1
  • Forum topics: 9
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 91
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 

Active 1 year ago
Joined Dec 2018
Points:
765

User statistics:

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

also its a custom table

 

Active 3 years ago
Joined Jan 2022
Points:
438

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 2
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