Minecraft Data Packs / Challenge

Weather and Seasons

  • check_circle Functions
  • check_circle Predicates
  • 11,071 views, 5 today
  • 1,097 downloads, 0 today
  • 40
  • 30
  • 7
Panzrom's Avatar Panzrom
Level 25 : Expert Miner
5
This datapack adds weather and seasons to the game. Each season lasts 8 Minecraft days and the weather will change depending on the season. There are currently 4 weather types: Sunny, Rain, Snow, Thunderstorm, Blizzard and Tornado.
The weather switches after 15 minutes but it can stop sooner. Each season lasts 16 minecraft days.
You can stop tornados/blizzards by killing the vex at the center. No tornados/blizzards will spawn after that.

You can manually change the weather with the following commands:

Sunny: /data modify storage panz_weather:weather weather set value 0
Snow: /data modify storage panz_weather:weather weather set value 1
Tornado: /data modify storage panz_weather:weather weather set value 2
Blizzard: /data modify storage panz_weather:weather weather set value 3
Thunder: /data modify storage panz_weather:weather weather set value 4
Rain: /data modify storage panz_weather:weather weather set value 5

This datapack is non destructive and hopefully not too anoying.
It also works in multiplayer. Have fun :)
CreditInspired by Extreme Weather and Seasons from cookedporkbacon.
CompatibilityMinecraft 1.18
toMinecraft 1.19
Tags

6 Update Logs

Update #6 : by Panzrom 02/04/2023 8:45:47 pmFeb 4th, 2023

- Fixed a bug that caused the season to reset to spring on loading.
LOAD MORE LOGS

Create an account or sign in to comment.

1
01/22/2023 3:36 amhistory
Level 1 : New Miner
togiez
togiez's Avatar
theres way to many tornados on my singleplayer world, any way to make them rarer?

also does the snow melt? I haven't tried the snow yet.
1
01/22/2023 2:41 pm
Level 25 : Expert Miner
Panzrom
Panzrom's Avatar
Currently the snowfall doesnt place or remove any snow in the world. They are just particles.
I changed this because it was too laggy. Maybe later i will add it back in again.
2
01/22/2023 2:35 pmhistory
Level 25 : Expert Miner
Panzrom
Panzrom's Avatar
I made an update and tuned the tornados down a bit.
But you can also edit the data\panz_weather\functions\new_weather.mcfunction. (You have to unzip it).
It looks like this:

execute if data storage panz_weather:time {season:"spring"} if predicate panz_weather:1_in_4 run data modify storage panz_weather:weather weather set value 1
execute if data storage panz_weather:time {season:"spring"} if predicate panz_weather:1_in_20 run data modify storage panz_weather:weather weather set value 2
execute if data storage panz_weather:time {season:"spring"} if predicate panz_weather:1_in_4 run data modify storage panz_weather:weather weather set value 0
execute if data storage panz_weather:time {season:"spring"} if predicate panz_weather:1_in_4 run data modify storage panz_weather:weather weather set value 5

The values correspond to the weather type (Tornado is 2). You can edit the predicate. Those are randomizer in the folder \data\panz_weather\predicates. You can only use them if the exist here. :1_in_40 for example doesnt exist but :1_in_50 does.

You can change for example:
execute if data storage panz_weather:time {season:"spring"} if predicate panz_weather:1_in_20 run data modify storage panz_weather:weather weather set value 2
to
execute if data storage panz_weather:time {season:"spring"} if predicate panz_weather:1_in_50 run data modify storage panz_weather:weather weather set value 2

and tornados will spawn very very rarely in the spring. You can also delete that line and tornados wont spawn in the spring.
1
02/05/2023 4:12 am
Level 40 : Master Miner
Lordphenex
Lordphenex's Avatar
Hello !
Since your datapack is in MC version 1.18-1.19, you can use value_check predicates to test if a number is greater or less than another one. I say that because this can allow the user to set up their own probability for each event through scoreboards. I think this would be easier for them as they don't need to go through all the datapack files.

Such predicate looks like this :
{
  "condition": "minecraft:value_check",
  "value": {
    "min": 0,
    "max": 100
  },
  "range": {
    "min": 0,
    "max": {
      "type": "minecraft:score",
      "score": "objectiveName",
      "target": {
        "type": "minecraft:fixed",
        "name": "scoreHolderName"
      }
      
    }
  }
}


This will test if a random number is between 0 and scoreHolderName score, meaning that scoreHolderName contains the probability of the event to happen in %.
With this you can easily modify the scoreHolderName score value to whatever probailibty you want in game.
Also, seeing what you wrote above, your probability of each event doesn't match the ones that are written in the predicates (weather value 1 has a probability of 0.13 to happen : 1/4 to be selected and 19/20*3/4*3/4 that none of the others is selected). Maybe it's intentional but if not, you can add something that test if the predicate was successfull and skip the other test, like an "execute store success" before "if predicate" and "execute unless success has happened before ...".

Anyway, interesting datapack !
Hope you find this^ useful !
1
02/05/2022 6:42 pm
Level 1 : New Collective
NNikitas
NNikitas's Avatar
is there a way for me to increase the length of seasons?
great work!
1
01/19/2023 7:01 pmhistory
Level 25 : Expert Miner
Panzrom
Panzrom's Avatar
Sorry for the late answer. First you have to download the latest zip. I changed some things and also increased the season lenght to 16 days.
You have to unzip the zipfile to edit the line:
execute if data storage panz_weather:time {moon:0s} run data modify storage panz_weather:time moon set value 16
in the file data/panz_weather/functions/new_day.mcfunction
The value of 16 is the number of days for each season.
1
01/22/2022 10:10 am
Level 25 : Expert Miner
Panzrom
Panzrom's Avatar
I patched some things. Please update.
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome