Topic category: Feature requests and ideas for MCreator
I have been using a piece of code for a while, and I'm starting to get a lot of locked code elements, making me worried for when Mcreator moves to 1.16 or 1.17 that I will have to re-do everything.
Could you add a 'choose random number from _ to _' procedure block?
Code looks like this:
import java.util.concurrent.ThreadLocalRandom; ThreadLocalRandom var1 = ThreadLocalRandom.current(); var2 = (int) var1.nextInt(3, 6); //pick random number from 3 to 5
I have used this code in so many different things. Like item spawning amount, structure height offset (I don't expect this one to be added), Spawning location, picking a random block to place, etc... I feel as if this would be very useful for modders. We already have the Math.random() function but we have to use a lot of if/else if statements, and are restricted to 0 - 1.
There is also the other random.nextInt() function, but that always starts at 0 to set number. (We can't set negatives with this)
Along with this, can we decide when creating a NUMBER variable to choose whether it is an Integer or a Double?