how can I call the current weather and the weather durration. I see it in there the methods anyways but I cant seem to get them to work can anyone show me how to set up the getWeatherDuration() and how to get what weather is currently going on.
I mean HasStorm and is Thundering are in the same boat I do World and getWorld() and I still cant seem to get to those methods for use
If you want to get the overworld, do: Code:java //this will be true iff the overworld is raining/snowingBukkit.getWorlds().get(0).hasStorm();
ok I got that and actually I needed to do it from the players perspective or so I thought. But it doesnt seem accurate even on clear sky's it still says there is a storm and for like 97 min. Code: else if(cmd.getName().equalsIgnoreCase("Weather")){ if(p.getTargetBlock(null, 10).getType() == Material.DIAMOND_BLOCK) { weather = p.getWorld().hasStorm(); int wtime = p.getWorld().getWeatherDuration(); int weathertime = wtime / 20 / 60; if(weather = false){ sender.sendMessage(ChatColor.DARK_AQUA+"Today we have clear skys hope you enjoy that sunny weather!"); } else if(weather = true){ sender.sendMessage(ChatColor.DARK_AQUA+ "Looks Like there is a storm today for the next " + weathertime + " minute(s)"); } } else { sender.sendMessage(ChatColor.DARK_RED+ "You need to be looking at a TV."); } it always says there is a storm even if there isnt one where the player is at.
You mean to use the comparison operator, == = is the assignment operator. However, in your case, you don't need either. Code:java if(weather) { //it is raining} else { //it is not raining}