INIT:/tellraw @a [{color:"aqua",bold:true,text:"MrGarretto's"},{color:"blue",bold:true,text:" Super Weather vanilla mod"},{color:"aqua",bold:true,text:" has been installed!"}]
INIT:/scoreboard objectives add TimeObjective dummy
INIT:/scoreboard objectives add MasterClock dummy
INIT:/scoreboard objectives add CurrentWeather dummy
INIT:/scoreboard objectives add Temperature dummy
INIT:/scoreboard objectives add LargeClock dummy
INIT:/scoreboard objectives add FinalWeather dummy
INIT:/scoreboard objectives add DistanceWalked stat.walkOneCm
INIT:/scoreboard objectives add Thirsty dummy
INIT:/scoreboard objectives add DRINKWATER stat.useItem.minecraft.potion
INIT:/scoreboard objectives add WEARCOAT dummy
/stats block ~ ~ ~2 set QueryResult @a TimeObjective
/time query daytime
/scoreboard players add @a TimeObjective 0
# Makes all master clocks constantly increasing, until they get to a certain number
/execute @a[score_TimeObjective_min=24000] ~ ~ ~ time set 0
/scoreboard players add @a MasterClock 1
/scoreboard players reset @a[score_MasterClock_min=10] MasterClock
# Same thing as above, but for LargeClock instead
/scoreboard players add @a LargeClock 1
/scoreboard players set @a[score_LargeClock_min=100] LargeClock 10
/execute @a[score_TimeObjective=1] ~ ~ ~ scoreboard players operation @a CurrentWeather = @a MasterClock
/execute @a[score_TimeObjective=1] ~ ~ ~ scoreboard players operation @a Temperature = @a LargeClock
/execute @a[score_TimeObjective=1] ~ ~ ~ title @a title ["",{"text":"Current temperature:","color":"yellow"}]
/execute @a[score_TimeObjective=1] ~ ~ ~ title @a subtitle ["",{"score":{"name":"@p","objective":"Temperature"},"color":"red"}]
# Keep track of how much the player needs water
/scoreboard players set @a[score_DRINKWATER_min=1] Thirsty -1
/scoreboard players reset @a DRINKWATER
/tellraw @a[score_Thirsty=-1] ["",{"text":"You are now hydrated!","color":"blue"}]
/scoreboard players set @a[score_Thirsty=-1] Thirsty 0
/scoreboard players add @a[score_Thirsty_min=1] Thirsty 1
/tellraw @a[score_Thirsty_min=800,score_Thirsty=800] ["",{"text":"You must drink some water! The temperature is too hot!","color":"red","bold":"true"}]
/execute @a[score_Thirsty_min=800] ~ ~ ~ effect @a 2 1 1 true
/execute @a[score_Thirsty_min=800] ~ ~ ~ effect @a 18 1 1 true
/execute @a[score_Thirsty_min=800] ~ ~ ~ effect @a 19 5 1 true
/execute @a[score_Thirsty_min=800] ~ ~ ~ effect @a 4 1 1 true
# Control very cold weather coats aka leather tunics
/scoreboard players set @a[score_TimeObjective_min=500] WEARCOAT 0
/execute @a[score_TimeObjective_min=500,score_TimeObjective=500,score_FinalWeather_min=1,score_FinalWeather=1] ~ ~ ~ tellraw @a ["",{"text":"It is very cold today! You must wear a leather coat or you will become sick!","color":"red"}]
/execute @a[score_FinalWeather_min=1,score_FinalWeather=1] ~ ~ ~ scoreboard players set @a WEARCOAT 1 {Inventory:[{Slot:102b,id:minecraft:leather_chestplate}]}
/execute @a[score_DistanceWalked_min=5000,score_FinalWeather_min=1,score_FinalWeather=1,score_WEARCOAT=0] ~ ~ ~ tellraw @a ["",{"text":"It is very cold today! You must wear a leather coat or you will continue to suffer!","color":"red"}]
/execute @a[score_FinalWeather_min=1,score_FinalWeather=1,score_WEARCOAT=0] ~ ~ ~ effect @a 2 1 1 true
/execute @a[score_FinalWeather_min=1,score_FinalWeather=1,score_WEARCOAT=0] ~ ~ ~ effect @a 4 1 1 true
/execute @a[score_FinalWeather_min=1,score_FinalWeather=1,score_WEARCOAT=0] ~ ~ ~ effect @a 20 1 1 true
/execute @a[score_DistanceWalked_min=5000,score_FinalWeather_min=1,score_FinalWeather=1] ~ ~ ~ scoreboard players reset @a DistanceWalked
# Don't let distance walked get too high and ALSO control distance based weather
/execute @a[score_DistanceWalked_min=40000,score_FinalWeather_min=2,score_FinalWeather=2] ~ ~ ~ weather thunder 3000
/execute @a[score_DistanceWalked_min=40000,score_FinalWeather_min=3,score_FinalWeather=3] ~ ~ ~ weather rain 2000
/execute @a[score_DistanceWalked_min=10000,score_FinalWeather_min=5,score_FinalWeather=5] ~ ~ ~ scoreboard players set @a Thirsty 1
/execute @a[score_DistanceWalked_min=10000,score_FinalWeather_min=5,score_FinalWeather=5] ~ ~ ~ tellraw @a ["",{"text":"You need to drink water! You are getting dehydrated!","color":"red"}]
/execute @a[score_DistanceWalked_min=10000,score_FinalWeather_min=5,score_FinalWeather=5] ~ ~ ~ scoreboard players reset @a DistanceWalked
/execute @a[score_DistanceWalked_min=40000] ~ ~ ~ scoreboard players reset @a DistanceWalked
# Separate different temperature groups
/execute @a[score_Temperature_min=10,score_Temperature=32] ~ ~ ~ scoreboard players set @a FinalWeather 1
/execute @a[score_Temperature_min=33,score_Temperature=46] ~ ~ ~ scoreboard players set @a FinalWeather 2
/execute @a[score_Temperature_min=47,score_Temperature=75] ~ ~ ~ scoreboard players set @a FinalWeather 3
/execute @a[score_Temperature_min=75,score_Temperature=84] ~ ~ ~ scoreboard players set @a FinalWeather 4
/execute @a[score_Temperature_min=85,score_Temperature=100] ~ ~ ~ scoreboard players set @a FinalWeather 5
# Do different things based on the final weather
# If very cold temp
/execute @a[score_FinalWeather_min=1,score_FinalWeather=1,score_TimeObjective=1] ~ ~ ~ tellraw @a ["",{"text":"The weather is very cold today - ","color":"dark_aqua"},{"text":"Be sure to wear a leather coat today!","color":"gold"}]
#
# If somewhat cold temp
/execute @a[score_FinalWeather_min=2,score_FinalWeather=2,score_TimeObjective=1] ~ ~ ~ tellraw @a ["",{"text":"The weather cold today - ","color":"dark_aqua"},{"text":"Possible chance of thunderstorms in your area","color":"blue"}]
#
# If average temp
/execute @a[score_FinalWeather_min=3,score_FinalWeather=3,score_TimeObjective=1] ~ ~ ~ tellraw @a ["",{"text":"The weather is somewhat cold today - ","color":"dark_aqua"},{"text":"Possible chance of some small rain showers","color":"blue"}]
#
# If mild temp
/execute @a[score_FinalWeather_min=4,score_FinalWeather=4,score_TimeObjective=1] ~ ~ ~ tellraw @a ["",{"text":"The weather is warm today - ","color":"dark_aqua"},{"text":"No weather alerts!","color":"green"}]
#
# If hot temp
/execute @a[score_FinalWeather_min=5,score_FinalWeather=5,score_TimeObjective=1] ~ ~ ~ tellraw @a ["",{"text":"The weather is hot today - ","color":"dark_aqua"},{"text":"Drink a lot of water!","color":"red"}]