I am currently trying to edit the following code in java with static numbers to show a number in a range (this code is showing the distance from a certain point in blocks, and I need to make it difficult to find the block):
int R = getBlockTypeDistance(event.getClickedBlock().getLocation(), stid);
if (R == -1){
player.sendMessage(ChatColor.BLUE + plugin.getConfig().getString("text.very_cold"));
} else if(R < 12) {
player.sendMessage(ChatColor.RED + plugin.getConfig().getString("text.very_hot"));
} else if(R < 18){
player.sendMessage(ChatColor.RED + plugin.getConfig().getString("text.hot"));
} else if(R < 27){
player.sendMessage(ChatColor.GOLD + plugin.getConfig().getString("text.warm"));
}
I am looking for a randomly generated number for each else if statement with the following ranges:
Instead of R < 12, a range between 0 and 15
Instead of R < 18, a range between 15 and 22
Instead of R < 27, a range between 22 and 30
All ranges should have a "weight" (90% chance of getting a number higher than 75% in the range)
Any help appreciated, thanks.