I'm currently trying on a new Minecraft Spigot plugin and would like to know if and / or how it is possible to include probabilities and how to spawn random zombies or other mobs in a certain field.
For example, I have a small area on which certain mobs spawn and these drop with a probability of eg. 1: 2000 an item.
I would have done it with a random, but I think that takes too long.
Hope you can help me.
P.s: I'm not a professional in programming, so please no expertise or similar.
What exactly takes too long?
When it comes to probability, what else should you take
How does that look then?
If I make r.nextInt (2000) do I have to set a drop for each integer?
(Do not know me so well, sry)
Unfortunately, I only know the Java Basics.
No, you do not have to. You can do this so that when the integer becomes 0, the item will drop. When the other 1999 numbers come, nothing happens
If 1> 1900
Int r = Random.nextInt (20000)
if r == 0 {
drop item