#Version 1.4.0.4
#In order to download or use this software, you must agree to it's license: http://pastebin.com/raw.php?i=JGSLhFdU
#Edit options and aliases to customize the skript
options:
rangeXZ : 100 #The distance on both horizontal axes in which puddles can form
rangeY : 20 #The distance on the Y axis in which puddles can form
#COMMENT FOR BELOW OPTION #The list of biomes that puddles cannot form in, make sure you have OR and not AND at the end
disallowed biome : Desert, Desert Mountains, Desert Hills, Savanna, Savanna Mountains, Savanna Plateau, Savanna Plateau Mountains, Mesa, Mesa Bryce, Mesa Plateau, Mesa Plateau Mountains, Mesa Plateau forest, Mesa Plateau forest mountains, Cold Taiga, Cold Taiga Mountains, Cold Taiga Hills, Ice Plains, Ice Plains Spikes, Ice Mountains, Cold Beach, Frozen River, or hell
aliases:
#USE NUMERICAL BLOCK IDS FOR THIS LIST
#
#
#
#LANDONABLE-Blocks that puddles can land on
#FALLTHROUGHABLE-Blocks that puddles can form under
#REPLACEABLE-Blocks that puddles can replace
landonable = 1, 2, 3, 4, 7, 12, 5, 17, 162, 13, 97, 98, 16, 15, 73, 14, 129, 56, 21
fallthroughable = 0, 18, 161, 8, 9, 175
replaceable = 0, 31, 32, 37, 38, 78:0, 175, #55 #(redstone not replaceable by default)
every 1 tick:
loop players:
if is raining or thundering in loop-player's world:
set {_valid.%loop-player%} to true
set {_loc} to location of loop-player
set {_horizontalX} to a random integer between (-{@rangeXZ} + loop-player's location's x-coordinate) and ({@rangeXZ} + loop-player's location's x-coordinate)
set {_horizontalZ} to a random integer between (-{@rangeXZ} + loop-player's location's z-coordinate) and ({@rangeXZ} + loop-player's location's z-coordinate)
set {_vertical} to a random integer between (-{@rangeY} + loop-player's location's y-coordinate) and ({@rangeY} + loop-player's location's y-coordinate)
set {_world} to loop-player's world
set {_puddleLoc} to loop-player's location
set the x-coordinate of {_puddleLoc} to {_horizontalX} - 0.5
set the y-coordinate of {_puddleLoc} to {_vertical} - 0.5
set the z-coordinate of {_puddleLoc} to {_horizontalZ}
if block at {_puddleLoc} is replaceable:
if block below {_puddleLoc} is landonable:
if biome at {_puddleLoc} is {@disallowed biome}:
set {_valid.%loop-player%} to false
else if biome at {_puddleLoc} is Extreme Hills, Extreme Hills Mountains, Extreme Hills Plus, or Extreme Hills Plus Mountains:
if {_vertical} >= 93:
set {_valid.%loop-player%} to false
loop blocks above block above {_puddleLoc}:
if loop-block is not fallthroughable:
set {_valid.%loop-player%} to false
else:
set {_valid.%loop-player%} to false
else:
set {_valid.%loop-player%} to false
if {_valid.%loop-player%} is true:
if {puddle.debug} is on:
message "Puddle added at %{_puddleLoc}% replacing %block at {_puddleLoc}%" to loop-player
add {_puddleLoc} to {puddleLocations.%loop-player's world%::*}
set block at {_puddleLoc} to air
wait 1 tick
set block at {_puddleLoc} to water
set data value of block at {_puddleLoc} to 7
command /puddletest:
trigger:
if command sender is an op:
set {_valid.%player%} to true
set {_loc} to location of player
set {_world} to player's world
set {_puddleLoc} to player's location
if block at {_puddleLoc} is replaceable:
if block below {_puddleLoc} is landonable:
if biome at {_puddleLoc} is {@disallowed biome}:
set {_valid.%player%} to false
else if biome at {_puddleLoc} is Extreme Hills, Extreme Hills Mountains, Extreme Hills Plus, or Extreme Hills Plus Mountains:
if {_vertical} >= 93:
set {_valid.%player%} to false
loop blocks above block above {_puddleLoc}:
if loop-block is not fallthroughable:
message "%loop-block% (%loop-block's id%:%loop-block's damage value%) is not fallthroughable"
set {_valid.%player%} to false
add loop-block to {_invalidBlocks::*}
if {_valid.%player%} is false:
loop 4 times:
loop {_invalidBlocks::*}:
make player see block at loop-value's location as red wool
wait 0.5 second
loop {_invalidBlocks::*}:
make player see block at loop-value's location as loop-value
wait 0.5 second
else:
set {_valid.%player%} to false
message "puddle cannot land on %block below {_puddleLoc}%"
wait 1 tick
loop 4 times:
make player see block below {_puddleLoc} as red wool
wait 0.5 second
make player see block below {_puddleLoc} as block below {_puddleLoc}
wait 0.5 second
else:
message "%block at {_puddleLoc}% is not replaceable"
loop 4 times:
make player see block at {_puddleLoc} as red wool
wait 0.5 second
make player see block at {_puddleLoc} as block at {_puddleLoc}
wait 0.5 second
set {_valid.%player%} to false
if {_valid.%player%} is true:
message "puddle is placeable at your feet"
add {_puddleLoc} to {puddleLocations.%player's world%::*}
else:
message "<red>You do not have permission to do this"
every 1 second:
loop worlds:
set {_chance} to 20%
if is raining in loop-world:
if time in loop-world is between 20:00 and 8:00:
set {_chance} to {_chance} * 0.25
else if time in loop-world is between 11:00 and 16:00:
set {_chance} to {_chance} * 0.75
else:
set {_chance} to {_chance} * 0.50
else if is thundering in loop-world:
if time in loop-world is between 20:00 and 8:00:
set {_chance} to {_chance} * 0.05
if time in loop-world is between 11:00 and 16:00:
set {_chance} to {_chance} * 0.2
else:
set {_chance} to {_chance} * 0.1
else if is sunny in loop-world:
if time in loop-world is between 20:00 and 8:00:
set {_chance} to {_chance} * 0.9
else if time in loop-world is between 11:00 and 16:00:
set {_chance} to {_chance} * 1.2
else:
set {_chance} to {_chance} * 1
else:
stop
chance of {_chance}:
set {_loc} to a random location out of {puddleLocations.%loop-world%::*}
if {_loc} is set:
if block at {_loc} is water:
if data value of block at {_loc} is 7:
set block at {_loc} to air
if {puddle.debug} is on:
broadcast "Puddle removed at %{_loc}%"
else if {puddle.debug} is on:
broadcast "Puddle no longer exists at %{_loc}%"
else if {puddle.debug} is on:
broadcast "Puddle no longer exists at %{_loc}%"
wait 1 tick
remove all {_loc} from {puddleLocations.%loop-world%::*}
if {weather.%loop-world%.timer} is set:
if {weather.%loop-world%.timer} > 0:
subtract 1 from {weather.%loop-world%.timer}
else:
execute the console command "/toggledownfall %loop-world%"
clear {weather.%loop-world%.timer}
command /puddles [<text>] [<text="%command sender's world%">]:
aliases: /puddle
trigger:
if player is an op:
if argument 1 is "clear":
if argument 2 is "all":
loop worlds:
loop {puddleLocations.%loop-world%::*}:
set block at loop-value to air
remove all loop-value from {puddleLocations.%loop-world%::*}
message "<light red>Cleared all puddles in all worlds..."
else if argument 2 is not "all":
loop {puddleLocations.%argument 2%::*}:
set block at loop-value to air
remove all loop-value from {puddleLocations.%argument 2%::*}
message "<light red>Cleared all puddles in world ""%argument 2%"""
else if argument 1 is "list":
if argument 2 is "all":
set {_amt} to 0
loop worlds:
loop {puddleLocations.%loop-world%::*}:
add 1 to {_amt}
message "(%{_amt}%). %loop-value% in world ""%loop-world%"""
else:
set {_amt} to 0
loop {puddleLocations.%argument 2%::*}:
add 1 to {_amt}
message "(%{_amt}%). %loop-value%" to command sender
message "<light green>Listed all puddles in world ""%argument 2%"""
else if argument 1 is "create":
set block at player's location to water
set data value of block at player's location to 7
message "%command sender% Created a puddle at %location of block at player's location%"
add location of block at player's location to {puddleLocations.%event-world%::*}
else:
message "<light red>/puddles <clear|list|create>"
else:
message "<red>You do not have permission to do this"
on physics:
if event-block is water:
if data value of event-block is 7:
set {_persist} to false
set {_loc} to event-block's location
subtract 0.5 from the z-coordinate of {_loc}
loop {puddleLocations.%event-world%::*}:
if "%loop-value%" = "%{_loc}%":
if block below event-block is landonable:
cancel the event
set {_persist} to true
if {_persist} is true:
if {puddle.debug} is true:
broadcast "Puddle persisting at %{_loc}%"
command /pdebug <boolean>:
trigger:
if command sender is an op:
set {puddle.debug} to argument 1
else:
message "<red>You do not have permission to do this"
Comments
0 B
|👍
/👎