Posted September 21, 201510 yr 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)? Don't blame me if i always ask for your help. I just want to learn to be better
September 22, 201510 yr 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. 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.
September 22, 201510 yr Author 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) Don't blame me if i always ask for your help. I just want to learn to be better
September 22, 201510 yr Did you experiment at all? try setRaining(false)? Look at the where the vanilla used that and see what it changes? Long time Bukkit & Forge Programmer Happy to try and help
September 22, 201510 yr Author 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 Don't blame me if i always ask for your help. I just want to learn to be better
September 22, 201510 yr 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? Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]
September 22, 201510 yr Author 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 Don't blame me if i always ask for your help. I just want to learn to be better
September 23, 201510 yr Author Any idea? Don't blame me if i always ask for your help. I just want to learn to be better
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.