anybody help me?

Started by sn4p on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
anybody help me?

Hi,
I want to create a system where opening a pack gives the player 6 random items from a pool of 20 available ones. Duplicates should sometimes occur, but not always I want the randomness to feel balanced.

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I suggest you use a local…
Fri, 01/31/2025 - 14:14

I suggest you use a local variable and have it when you open the pack it randomizes it 6 times. Then use 20 if statements for each item. Example would be: when player opens pack, set local variable to (random integer 1-20 included). Then "if variable1 = 1, give event/target entity diamond 1"

                                                         " variable1 = 2, give event/target entity coal 1" etc...

here is an example with 6 items in a pool of 5:

https://imgur.com/a/wQZAdE6

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
okey thank you
Fri, 01/31/2025 - 21:35

okey thank you

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
what variable type?  
Fri, 01/31/2025 - 22:18

what variable type?

 

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
number
Sat, 02/01/2025 - 01:20

number

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hello again  How do I set…
Tue, 02/04/2025 - 13:01

hello again 

How do I set the drop rate so that 5 items each have a 50% chance, but one special item has only a 0.01% chance?

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can increase the chances…
Wed, 02/05/2025 - 13:14

You can increase the chances of certain items by assigning more than one number value to them. I'm assuming you don't actually want 50 % because it is impossible to have 5 items all with 50 % chance. Regardless, If you want 5 items to be common with 1 item being rare, this is how you would do it:

https://imgur.com/a/OeLyNIA Set it up so the variable is much larger and the 5 common items are ranges, but the one rare item is not a range. You can adjust the numbers to decrease or increase rarity.

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to combine this with the…
Wed, 02/05/2025 - 15:36

How to combine this with the previous procedure so that it works with those 20 items and drops 6 items from one pack?

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I am not exactly sure what…
Thu, 02/06/2025 - 23:50

I am not exactly sure what you mean, but the increasing the repeat block will increase the number of items given. Adding more actual "if variable = /give @s" statements will add more items to the pool of items. Just make sure to keep the random integer variable range in respect to the items in the pool. It's a little complicated, but if you want to adjust the rarity of each item increase the number range of the "if variable = /give @s" statements.

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If I want to add more rare…
Fri, 02/07/2025 - 03:16

If I want to add more rare items, do I have to set the same single number? because when I give a higher number to each rare item, suddenly the package drops 3 or 4 items instead of 6

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't know exactly your…
Fri, 02/07/2025 - 15:24

I don't know exactly your procedure and you may add changes so I will show you how the mechanism works:

https://imgur.com/a/rTUezVb

This is a graph of the basic idea of how the random number and pool system works. Your basically dividing the range of the number into fractions. Keep in mind that when actually implementing this, the number should be 1 number off and along with item ranges. Like this instead: random integer 1-101. and the items would have ranges like "if variable >0 and <11". that will give it a 1-10 range.

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
thank you so much 
Fri, 02/07/2025 - 23:55

thank you so much