JimiIT92 Posted September 21, 2015 Posted September 21, 2015 Is there any chanche to change the weather when an event occurs? For example, i have a tile entity that spawns 4 mobs, then it destroys itself. How can i do to also change the weather to thunder before it disappear (so: it spawns the mob and then it change the weather to thunder)? Quote Don't blame me if i always ask for your help. I just want to learn to be better
Choonster Posted September 22, 2015 Posted September 22, 2015 Use the setRaining , setRainTime , setThundering and setThunderTime methods of WorldInfo ( World#getWorldInfo will return the World 's WorldInfo instance). This should be done on the server, the clients will be automatically notified of the change. Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
JimiIT92 Posted September 22, 2015 Author Posted September 22, 2015 Ok, so i've do this this.worldObj.getWorldInfo().setCleanWeatherTime(0); this.worldObj.getWorldInfo().setRainTime(0); this.worldObj.getWorldInfo().setThunderTime(12000); this.worldObj.getWorldInfo().setRaining(true); this.worldObj.getWorldInfo().setThundering(true); it works, but now i am wondering if there is any way to spawn only thunders (without the rain) Quote Don't blame me if i always ask for your help. I just want to learn to be better
delpi Posted September 22, 2015 Posted September 22, 2015 Did you experiment at all? try setRaining(false)? Look at the where the vanilla used that and see what it changes? Quote Long time Bukkit & Forge Programmer Happy to try and help
JimiIT92 Posted September 22, 2015 Author Posted September 22, 2015 The code above is the exact code that vanilla use when the player does the weather thunder command. I've tried using setRaining(false) but if i do also the thunders doesn't spawns Quote Don't blame me if i always ask for your help. I just want to learn to be better
EverythingGames Posted September 22, 2015 Posted September 22, 2015 The code above is the exact code that vanilla use when the player does the weather thunder command. I've tried using setRaining(false) but if i do also the thunders doesn't spawns Are you calling this on the server? Quote Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]
JimiIT92 Posted September 22, 2015 Author Posted September 22, 2015 i'm calling it from here if(!this.worldObj.isRemote) { this.worldObj.getWorldInfo().setCleanWeatherTime(0); this.worldObj.getWorldInfo().setRainTime(0); this.worldObj.getWorldInfo().setThunderTime(12000); this.worldObj.getWorldInfo().setRaining(true); this.worldObj.getWorldInfo().setThundering(true); } Is it correct? Doing this i have no problem, the weather is changed as well I'm just wondering if there is a way to not spawn the rain (so making the sky darker and make it thundering but without raining). As i said before i tried setting false the setRaining parameter, but if i do it will not change the weather Quote Don't blame me if i always ask for your help. I just want to learn to be better
JimiIT92 Posted September 23, 2015 Author Posted September 23, 2015 Any idea? Quote Don't blame me if i always ask for your help. I just want to learn to be better
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.