Is a season cycle skript viable?

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

aescraft

Well-Known Member
Mar 1, 2017
295
13
0
36
I searched the docs trying to find something to work with the change in the crop grow rate, to create a seasonal cycle for the crops, but I could not find it.

Anyone has anything in mind on how to do it? I never tried, but it's possible to the skript change the spigot.yml or bukkit.yml files to do this? As the cycle would be long, something like a week, there's no problem on the changes being applied after the restart.

Thanks.
 
code_language.skript:
[on] (block|crop) grow[ing]
From Skellett


code_language.skript:
on crop grow:
    if "%crop state of event-block%" is "RIPE":
        broadcast "Yay your plant at %location of event-block% is ready!"
This doesn't properly return the crop state. I will fix that in the next version. So you have to test for it like how I tested for it. This is an old syntax in Skellett and needs fixing up, but should still work :emoji_grinning:

Crop states: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/CropState.html
 
code_language.skript:
[on] (block|crop) grow[ing]
From Skellett


code_language.skript:
on crop grow:
    if "%crop state of event-block%" is "RIPE":
        broadcast "Yay your plant at %location of event-block% is ready!"
This doesn't properly return the crop state. I will fix that in the next version. So you have to test for it like how I tested for it. This is an old syntax in Skellett and needs fixing up, but should still work :emoji_grinning:

Crop states: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/CropState.html
I'll try it later
But how could I set the crop grow state on it? The check itself would be useless. Ok, can be useful to cancel the event or like 90% chance of cancel on winter, but in summer I want to the crops grow faster.

I think that the editing of bukkit.yml would be the only way for that.

set "%PLANTGROWRATE%" to "%150%" in yaml file "bukkit.yml"
 
I'll try it later
But how could I set the crop grow state on it? The check itself would be useless. Ok, can be useful to cancel the event or like 90% chance of cancel on winter, but in summer I want to the crops grow faster.

I think that the editing of bukkit.yml would be the only way for that.

set "%PLANTGROWRATE%" to "%150%" in yaml file "bukkit.yml"
Your best bet is probably gonna be using an event when something is planted then using the "setState" over the time you want it to grow
 
Your best bet is probably gonna be using an event when something is planted then using the "setState" over the time you want it to grow
This would probably be too much resource intensive, a timer running for each plant? And would also need a stop when the chunk is unloaded.
 
This would probably be too much resource intensive, a timer running for each plant? And would also need a stop when the chunk is unloaded.
Not really intensive, you could just do basic waits, or for more reliability you can just add all crops to a list that you loop through every x minutes and progress their growth, and then remove them from the list if they are done growing. You could even add a check to make sure its chunk is loaded, but I'm pretty sure it won't matter because I don't think the growth state change would even happen if the chunk is unloaded.
 
Not really intensive, you could just do basic waits, or for more reliability you can just add all crops to a list that you loop through every x minutes and progress their growth, and then remove them from the list if they are done growing. You could even add a check to make sure its chunk is loaded, but I'm pretty sure it won't matter because I don't think the growth state change would even happen if the chunk is unloaded.
I'll try the simple way, creating a calendar and a season cycle with the .yml modify of bukkit.yml, changing the values of the crops.
If it wont work, I'll do the "hard" way.
 
Status
Not open for further replies.