How can I summon a RANDOM entity?

Started by Arturinelhuevin on Wed, 06/29/2022 - 14:08

Topic category: Help with modding (Java Edition)

Last seen on 12:19, 13. Aug 2022
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How can I summon a RANDOM entity?
Wed, 06/29/2022 - 14:08

I'm trying to make an item that summons a random entity of the game (includying my custom mobs, but right now I don't have any).

How can I summon a random entity when I right click the item? And what if I have custom mobs?

Last seen on 12:19, 13. Aug 2022
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Can someone help me, please?
Sat, 07/02/2022 - 17:15

Can someone help me, please?

Last seen on 01:58, 13. Aug 2022
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Make an RNG procedure that…
Fri, 08/05/2022 - 21:50

Make an RNG procedure that sets a custom local variable to a random number between 1 and... however many different types of creatures you want the item to be able to summon. Then, make an 'Else If' block that checks if the number is one, and summons whichever creature you assign to one, then checks if the number is two, and if so spawns whichever creature is assigned to two... and so on and so forth.

You can find RNG blocks in the Math tab, and custom variables to the right of the screen when you're designing a procedure. You can also assign a range of numbers for different entities to make some more likely than others- if, for example, the variable is set to a random number 1-30, you could assign any number greater than 0 and less than four to one type of entity, giving it a 10% chance of spawning.

Last seen on 12:19, 13. Aug 2022
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Thanks you so much! I don't…
Sat, 08/06/2022 - 03:38

Thanks you so much!

I don't know why I hadn't thought of it before lmao.

And again, thanks for your reply :)