Hey everyone, I was wondering if it was possible to change a biome to a winter biome, and make it continuously snow, and then after reset it back to a normal biome. The reason I am asking is because I want to make a holiday themed spawn, so it starts snowing, but its not possible to make it snow in a normal biome, so is there a plugin to change a biome, and is there a plugin to make it always snow (downfall)?
FTC are you asking if it is possible and if so what the code would look like, or for a plugin that does it?
I think a little bit of both, I am experienced with Java a little bit, not much though, but if there such a plugin? If not then yes, I would like to know how it would look.
In the ChunkGenerator Class of bukkit itself there is a method called setBiome(); probably would need to work with that
Ok I got BiomeEdit todo the main job, changing the biome to Winter Biome, but now what I need is for the downfall to always be on for this world
Listen for the WeatherChangeEvent and whenever it is called, cancel it and set the current weather to RAIN
FTC_WTFire7 In Minecraft, weather takes place everywhere and at the same time. So if it's raining one place, it's snowing in another. If it's clear at one place, it's clear at the other.
Code:java @EventHandler public void weatherChangeEvent(WeatherChangeEvent e){ e.getWorld().setWeatherDuration(Integer.MAX_VALUE); } Or something along that line. You can also check if the changed weather is clear (Aka if the snow stops) and use e.setCancelled(true). I'm not using any program for the code above, it may need a little tweaking.
Hmm... So I can assign a command to that, so what would the code look like if I were to make it so if it is cancelled, it will be automattcly uncanceled
FTC_WTFire7 I already posted it, but here it is again: @EventHandler public void weatherChangeEvent(WeatherChangeEvent e){ e.getWorld().setWeatherDuration(Integer.MAX_VALUE); } This is what it does. It first detects if the weather changes, then makes it rain for infinity. I guess you could put thebinfinity bit on the onEnable() method, but I put it in the event.
Hmm, alright ill try that out, thanks for your help. Wait, one more question, will this do something for all worlds, or just one, because I just want it on the spawn world. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
FTC_WTFire7 All worlds, obviously. You need to check if it is the world that you want weather enabled in.
That would be for all worlds. You can do Code: @EventHandler public void onSnow(WeatherChangeEvent e){ if(e.getWorld().equals(Bukkit.getWorld("YOUR_WORLD"){ e.getWorld().setWeatherDuration(Integer.MAX_VALUE) } }
FTC_WTFire7 Also, to check if it is beginning to rain or not: Code: if(e.toWeatherState()) { //now raining } else { //no longer raining }