MrGarretto

Advanced Weather Source

Mar 3rd, 2015
564
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.51 KB | None | 0 0
  1. # Source code for MrGarretto's advanced weather in one command block
  2. # To compile this, paste it into the command dumper: http://mrgarretto.com/commanddump
  3. # You do not need to remove these comments. My command dumper will automatically remove all of them!
  4. #
  5. 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!"}]
  6. INIT:/scoreboard objectives add TimeObjective dummy
  7. INIT:/scoreboard objectives add MasterClock dummy
  8. INIT:/scoreboard objectives add CurrentWeather dummy
  9. INIT:/scoreboard objectives add Temperature dummy
  10. INIT:/scoreboard objectives add LargeClock dummy
  11. INIT:/scoreboard objectives add FinalWeather dummy
  12. INIT:/scoreboard objectives add DistanceWalked stat.walkOneCm
  13. INIT:/scoreboard objectives add Thirsty dummy
  14. INIT:/scoreboard objectives add DRINKWATER stat.useItem.minecraft.potion
  15. INIT:/scoreboard objectives add WEARCOAT dummy
  16. /stats block ~ ~ ~2 set QueryResult @a TimeObjective
  17. /time query daytime
  18. /scoreboard players add @a TimeObjective 0
  19. # Makes all master clocks constantly increasing, until they get to a certain number
  20. /execute @a[score_TimeObjective_min=24000] ~ ~ ~ time set 0
  21. /scoreboard players add @a MasterClock 1
  22. /scoreboard players reset @a[score_MasterClock_min=10] MasterClock
  23. # Same thing as above, but for LargeClock instead
  24. /scoreboard players add @a LargeClock 1
  25. /scoreboard players set @a[score_LargeClock_min=100] LargeClock 10
  26. /execute @a[score_TimeObjective=1] ~ ~ ~ scoreboard players operation @a CurrentWeather = @a MasterClock
  27. /execute @a[score_TimeObjective=1] ~ ~ ~ scoreboard players operation @a Temperature = @a LargeClock
  28. /execute @a[score_TimeObjective=1] ~ ~ ~ title @a title ["",{"text":"Current temperature:","color":"yellow"}]
  29. /execute @a[score_TimeObjective=1] ~ ~ ~ title @a subtitle ["",{"score":{"name":"@p","objective":"Temperature"},"color":"red"}]
  30. # Keep track of how much the player needs water
  31. /scoreboard players set @a[score_DRINKWATER_min=1] Thirsty -1
  32. /scoreboard players reset @a DRINKWATER
  33. /tellraw @a[score_Thirsty=-1] ["",{"text":"You are now hydrated!","color":"blue"}]
  34. /scoreboard players set @a[score_Thirsty=-1] Thirsty 0
  35. /scoreboard players add @a[score_Thirsty_min=1] Thirsty 1
  36. /tellraw @a[score_Thirsty_min=800,score_Thirsty=800] ["",{"text":"You must drink some water! The temperature is too hot!","color":"red","bold":"true"}]
  37. /execute @a[score_Thirsty_min=800] ~ ~ ~ effect @a 2 1 1 true
  38. /execute @a[score_Thirsty_min=800] ~ ~ ~ effect @a 18 1 1 true
  39. /execute @a[score_Thirsty_min=800] ~ ~ ~ effect @a 19 5 1 true
  40. /execute @a[score_Thirsty_min=800] ~ ~ ~ effect @a 4 1 1 true
  41. # Control very cold weather coats aka leather tunics
  42. /scoreboard players set @a[score_TimeObjective_min=500] WEARCOAT 0
  43. /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"}]
  44. /execute @a[score_FinalWeather_min=1,score_FinalWeather=1] ~ ~ ~ scoreboard players set @a WEARCOAT 1 {Inventory:[{Slot:102b,id:minecraft:leather_chestplate}]}
  45. /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"}]
  46. /execute @a[score_FinalWeather_min=1,score_FinalWeather=1,score_WEARCOAT=0] ~ ~ ~ effect @a 2 1 1 true
  47. /execute @a[score_FinalWeather_min=1,score_FinalWeather=1,score_WEARCOAT=0] ~ ~ ~ effect @a 4 1 1 true
  48. /execute @a[score_FinalWeather_min=1,score_FinalWeather=1,score_WEARCOAT=0] ~ ~ ~ effect @a 20 1 1 true
  49. /execute @a[score_DistanceWalked_min=5000,score_FinalWeather_min=1,score_FinalWeather=1] ~ ~ ~ scoreboard players reset @a DistanceWalked
  50. # Don't let distance walked get too high and ALSO control distance based weather
  51. /execute @a[score_DistanceWalked_min=40000,score_FinalWeather_min=2,score_FinalWeather=2] ~ ~ ~ weather thunder 3000
  52. /execute @a[score_DistanceWalked_min=40000,score_FinalWeather_min=3,score_FinalWeather=3] ~ ~ ~ weather rain 2000
  53. /execute @a[score_DistanceWalked_min=10000,score_FinalWeather_min=5,score_FinalWeather=5] ~ ~ ~ scoreboard players set @a Thirsty 1
  54. /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"}]
  55. /execute @a[score_DistanceWalked_min=10000,score_FinalWeather_min=5,score_FinalWeather=5] ~ ~ ~ scoreboard players reset @a DistanceWalked
  56. /execute @a[score_DistanceWalked_min=40000] ~ ~ ~ scoreboard players reset @a DistanceWalked
  57. # Separate different temperature groups
  58. /execute @a[score_Temperature_min=10,score_Temperature=32] ~ ~ ~ scoreboard players set @a FinalWeather 1
  59. /execute @a[score_Temperature_min=33,score_Temperature=46] ~ ~ ~ scoreboard players set @a FinalWeather 2
  60. /execute @a[score_Temperature_min=47,score_Temperature=75] ~ ~ ~ scoreboard players set @a FinalWeather 3
  61. /execute @a[score_Temperature_min=75,score_Temperature=84] ~ ~ ~ scoreboard players set @a FinalWeather 4
  62. /execute @a[score_Temperature_min=85,score_Temperature=100] ~ ~ ~ scoreboard players set @a FinalWeather 5
  63. # Do different things based on the final weather
  64. # If very cold temp
  65. /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"}]
  66. #
  67. # If somewhat cold temp
  68. /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"}]
  69. #
  70. # If average temp
  71. /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"}]
  72. #
  73. # If mild temp
  74. /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"}]
  75. #
  76. # If hot temp
  77. /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"}]
Advertisement
Add Comment
Please, Sign In to add comment