Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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 :)

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.

  • 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 :)

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

  • 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 :)

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]

  • 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 :)

  • 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.