event:
set event-player's weather to rain
another event:
event-player's weather is rain
event-world is hub
set event-player's weather to clear
No idea if this is in any way realistic. I'm only suggesting it, because i know essentials has some commands to set players' individual weather and therfore believe it can't be too much of a hassle.
Cheers!
Yes, this is very realistic, it's just a few methods on the Player class:
getPlayerWeather()
setPlayerWeather(WeatherType)
resetPlayerWeather()
Should be very doable. For now, there are some add-ons that have support for this if you need it (search the docs), but this would make sense to add to vanilla Skript.
(clear|sun[ny])
(rain|snow)[y]
would be good syntaxes for weather types
I imagine it would just use the same syntax as the already existing weather type which is used when changing weather.
The more you know, i thought that was part of skquery
Do you think event-player's weather should return null (like Bukkit does) if player is seeing default world weather, or always the actual wether they are seeing?
And if we choose to return default world weather, %player% (is seeing|is experiencing|has) custom weather or some better syntax would be needed (what would the syntax be?)
If we choose to return null then scripters can just use if weather of event-player is set.. what do you think?
(I'm going to add a pull request for this btw, because of Hacktoberfest ;) )
I can see why you ask and benefits to both implementations, but it should probably just work the same as Bukkit, returning null if they're seeing default weather. I can see conveniences with it returning the actual weather but it's not very intuitive that player-specific weather would return something other than null when they're not experiencing player-specific weather.
There's also the option of making it return null if they're seeing default weather and also adding another, separate expression which returns the weather they're currently experiencing regardless of whether it's player weather or world weather.
So glad to see this might actually see the light of day! :)
I came here to note that there are apparently two major ways to change the weather of the player, not regarding methods, but the transition. I've by now encountered multiple plugins that are capable of changing player weather. Some of them, provide a smooth transition, as in it takes a few seconds to crossover between world weather and the set player weather. Then again, in others, like worldguard, the change between world weather and set player weather is instant (and a bit non-immersive imo.) ^^
Just wanted to get this out there. :) Maybe something like this is possible:
set player's weather to clear/rain/thunder with hard/smooth transition
Hmm @jaylawl good question, I wrote the code already but I need to setup a test server before pull requesting it and actually test that with a script (hopefully Skript will compile after being touched by IntelliJ lol), so I'll let you know later, but anyways I suppose by default it will be instant unfortunately, hmm.. We will see, I'll setup the server first, later today probaby ;)
@Nicofisi kudos for setting that stuff up! Looking forward to see it implemented in Skript. :)
Regarding the smooth transition between world and player weather, it may be worth looking into the code of the plugin "WeatherMan" which is the only plugin i know of that provides said smooth transition. Just a heads up though if you're interested in how that works. I wouldn't know, i can barely read any java.
/edit:
Essentials also has the smooth transition in it's own "/pweather" command. :)
/edit 2:
One more observation i made: when i log onto my server and then walk into a region in which i set the weather to differ from the world's weather, the first transition is actually smooth. All suceeding being hard.
Do not get me wrong though, even the hard transition is a highly valuable addition already, i'm very happy this suggestion was met with so much good will. :)
Most helpful comment
Hmm @jaylawl good question, I wrote the code already but I need to setup a test server before pull requesting it and actually test that with a script (hopefully Skript will compile after being touched by IntelliJ lol), so I'll let you know later, but anyways I suppose by default it will be instant unfortunately, hmm.. We will see, I'll setup the server first, later today probaby ;)