options:
hook : spruce log
maxchain : 100
hooktimer : 1
batch: 10
on quit:
clear {_hooknum.%player%}
clear {hookshot.clear.%player%::*}
clear {hookshot.entity.%player%::*}
clear {_hookshot.solid.%player%::1}
remove slowness from player
remove jump boost from player
set {hookshot.use.%player%} to false
set level of player to 0
on break of bars:
if {hookshot.clear.%player%::*} is set:
cancel event
command /hookshot:
trigger:
give player a tripwire hook named "&7Hookshot"
message "You found a Hookshot!"
play raw sound "note.pling" at player with pitch 1.2 volume 2
play raw sound "note.pling" at player with pitch 1.2 volume 2
play raw sound "note.bd" at player with pitch 1.4 volume 2
play raw sound "note.snare" at player with pitch 1 volume 2
wait 5.5 ticks
play raw sound "note.pling" at player with pitch 1.3 volume 2
play raw sound "note.pling" at player with pitch 1.3 volume 2
wait 5.5 ticks
play raw sound "note.pling" at player with pitch 1.35 volume 2
play raw sound "note.pling" at player with pitch 1.35 volume 2
play raw sound "note.bd" at player with pitch 1.4 volume 2
play raw sound "note.snare" at player with pitch 1 volume 2
wait 5.5 ticks
play raw sound "note.pling" at player with pitch 1.4 volume 2
play raw sound "note.pling" at player with pitch 1.4 volume 2
loop 11 times:
play raw sound "note.snare" at player with pitch 1 volume 2
play raw sound "note.bd" at player with pitch 1.4 volume 2
wait 2.5 ticks
on right click:
player is holding a tripwire hook named "&7Hookshot":
cancel event
if {hookshot.use.%player%} is not set:
set {hookshot.use.%player%} to false
if {hookshot.use.%player%} is true:
cancel event
if {hookshot.use.%player%} is false:
apply slowness 10 to player for 999 days
apply jump boost -10 to player for 999 days
set {hookshot.use.%player%} to true
set level progress of player to .999
play raw sound "mob.zombie.woodbreak" at location of player with pitch 3 volume 2
loop blocks 1 above blocks infront of player:
loop-block is water or air or lava:
if size of {hookshot.clear.%player%::*} is {@maxchain}:
set {_hookshot.solid.%player%::1} to loop-block
stop loop
else:
add loop-block to {hookshot.clear.%player%::*}
else:
set {_hookshot.solid.%player%::1} to loop-block
stop loop
loop {hookshot.clear.%player%::*}:
play raw sound "random.click" at location of loop-value with pitch 2 volume .4
play raw sound "step.grass" at location of loop-value with pitch 3 volume 2
play raw sound "step.grass" at location of loop-value with pitch 3 volume 2
play raw sound "step.grass" at location of loop-value with pitch 3 volume 2
set block at loop-value to bars
add 1 to {_batch}
if {_batch} is greater than {@batch}:
wait {@hooktimer} ticks
delete {_batch}
block at {_hookshot.solid.%player%::1} is not {@hook}:
loop entities in radius 2 around block at {_hookshot.solid.%player%::1}:
loop-entity is not player:
add loop-entity to {hookshot.entity.%player%::*}
set {_hooknum.%player%} to size of {hookshot.clear.%player%::*}
if size of {hookshot.entity.%player%::*} is 0:
spawn 10 of "blockcrack_42_42" data 0 offset with 0, 0, 0 at location of {_hookshot.solid.%player%::1}
play raw sound "mob.zombie.metal" at location of player with pitch 0 volume 2
else:
spawn 10 of "blockcrack_147_147" data 0 offset with 0, 0, 0 at location of {_hookshot.solid.%player%::1}
play raw sound "random.levelup" at location of player with pitch 3 volume 2
loop size of {hookshot.clear.%player%::*} times:
if block 1 north, south, east, or west of {hookshot.clear.%player%::%{_hooknum.%player%}%} is water:
set block at {hookshot.clear.%player%::%{_hooknum.%player%}%} to water
else if block 1 north, south, east, or west of {hookshot.clear.%player%::%{_hooknum.%player%}%} is lava:
set block at {hookshot.clear.%player%::%{_hooknum.%player%}%} to lava
else:
set block at {hookshot.clear.%player%::%{_hooknum.%player%}%} to air
loop {hookshot.entity.%player%::*}:
teleport loop-value to location of {hookshot.clear.%player%::%{_hooknum.%player%}%}
remove 1 from {_hooknum.%player%}
add 1 to {_batch}
if {_batch} is greater than {@batch}:
wait {@hooktimer} ticks
delete {_batch}
else:
block at location of {_hookshot.solid.%player%::1} is not block {@maxchain} above player:
spawn 20 of "blockcrack_3_3" data 0 offset with 0, 0, 0 at location of {_hookshot.solid.%player%::1}
play raw sound "mob.zombie.wood" at location of player with pitch 2 volume 2
loop {hookshot.clear.%player%::*}:
if block 1 north, south, east, or west of loop-value-1 is water:
set block at loop-value-1 to water
else:
set block at loop-value-1 to air
teleport player to location of loop-value-1
add 1 to {_batch}
if {_batch} is greater than {@batch}:
wait {@hooktimer} ticks
delete {_batch}
else:
loop entities in radius 2 around block at {_hookshot.solid.%player%::1}:
loop-entity is not player:
add loop-entity to {hookshot.entity.%player%::*}
set {_hooknum.%player%} to size of {hookshot.clear.%player%::*}
if size of {hookshot.entity.%player%::*} is 0:
spawn 20 of "blockcrack_42_42" data 0 offset with 0, 0, 0 at location of {_hookshot.solid.%player%::1}
play raw sound "mob.zombie.metal" at location of player with pitch 0 volume 2
else:
spawn 30 of "blockcrack_147_147" data 0 offset with 0, 0, 0 at location of {_hookshot.solid.%player%::1}
play raw sound "random.levelup" at location of player with pitch 3 volume 2
loop size of {hookshot.clear.%player%::*} times:
if block 1 north, south, east, or west of {hookshot.clear.%player%::%{_hooknum.%player%}%} is water:
set block at {hookshot.clear.%player%::%{_hooknum.%player%}%} to water
else if block 1 north, south, east, or west of {hookshot.clear.%player%::%{_hooknum.%player%}%} is lava:
set block at {hookshot.clear.%player%::%{_hooknum.%player%}%} to lava
else:
set block at {hookshot.clear.%player%::%{_hooknum.%player%}%} to air
loop {hookshot.entity.%player%::*}:
teleport loop-value to location of {hookshot.clear.%player%::%{_hooknum.%player%}%}
remove 1 from {_hooknum.%player%}
add 1 to {_batch}
if {_batch} is greater than {@batch}:
wait {@hooktimer} ticks
delete {_batch}
clear {hookshot.clear.%player%::*}
clear {hookshot.entity.%player%::*}
remove slowness from player
remove jump boost from player
loop 25 times:
increase level progress of player by -3.995%
wait 1 tick
play raw sound "random.click" at player with pitch 3 volume 2
play raw sound "random.orb" at player with pitch 3 volume 2
set level of player to 0
set {hookshot.use.%player%} to false