Files
plugins
Code
2 162
plugins/Skript/scripts/actionbar_ready_clean.sk
# ActionBar Tidal Wave — Imber Gem ability
# Shows 3 "Ready!" messages on the action bar when holding Imber Gem (custom model data 200)
# Shift-right-click to unleash a 360 tidal wave (30s cooldown)
# Requires: SkBee
options:
prefix: &6[ActionBar]&r
on load:
send "{@prefix} &aLoaded!" to console
# Action bar — persistent every tick
on every 1 tick:
loop all players:
if "%custom model data of loop-player's tool%" is "200":
if {cooldown::imbergem::%loop-player%} > 0:
send action bar "&aReady! &e%{cooldown::imbergem::%loop-player%}s &aReady!" to loop-player
else:
send action bar "&aReady! &aReady! &aReady!" to loop-player
# Tidal wave on shift-right-click
on right click:
if player is sneaking:
if "%custom model data of player's tool%" is "200":
if {cooldown::imbergem::%player%} > 0:
send "&cTidal wave on cooldown! &e%{cooldown::imbergem::%player%}s" to player
stop
# Start cooldown (30 seconds)
set {cooldown::imbergem::%player%} to 30
# Sound
play sound "entity.elder_guardian.curse" at player with volume 2 and pitch 0.5
# Location
set {_loc} to location of player
set {_y} to y of {_loc}
set {_w} to world of player
# Ring 1 — radius 3
loop 16 times:
set {_angle} to loop-number * 22.5
set {_px} to x of {_loc} + 3 * cos({_angle})
set {_pz} to z of {_loc} + 3 * sin({_angle})
set {_ploc} to location({_px}, {_y}, {_pz}, {_w})
spawn 1 of "splash" at {_ploc}
# Ring 2 — radius 6
loop 16 times:
set {_angle} to loop-number * 22.5
set {_px} to x of {_loc} + 6 * cos({_angle})
set {_pz} to z of {_loc} + 6 * sin({_angle})
set {_ploc} to location({_px}, {_y}, {_pz}, {_w})
spawn 1 of "splash" at {_ploc}
# Ring 3 — radius 9
loop 16 times:
set {_angle} to loop-number * 22.5
set {_px} to x of {_loc} + 9 * cos({_angle})
set {_pz} to z of {_loc} + 9 * sin({_angle})
set {_ploc} to location({_px}, {_y}, {_pz}, {_w})
spawn 1 of "splash" at {_ploc}
# Center burst
spawn 5 of "explosion" at {_loc}
# Water blocks in a circle (radius 3)
set {_wid} to random integer between 1 and 1000000
loop 8 times:
set {_angle} to loop-number * 45
set {_wx} to x of {_loc} + 3 * cos({_angle})
set {_wz} to z of {_loc} + 3 * sin({_angle})
set {_wpos} to location({_wx}, {_y}, {_wz}, {_w})
set block at {_wpos} to water
add {_wpos} to {waterblocks::%player%::%_wid%::*}
# Remove water blocks after 3 seconds
set {_task} to random integer between 1 and 1000000
set {task::water::%_task%} to {_wid}
set {task::player::%_task%} to player
# Damage and push all entities in radius 6
loop all entities in radius 6 of player:
if loop-entity is not player:
damage loop-entity by 6
apply slowness 1 to loop-entity for 3 seconds
set {_dx} to x of loop-entity - x of player
set {_dz} to z of loop-entity - z of player
set {_dist} to sqrt({_dx} * {_dx} + {_dz} * {_dz})
if {_dist} > 0:
set {_dx} to {_dx} / {_dist} * 2
set {_dz} to {_dz} / {_dist} * 2
set velocity of loop-entity to vector({_dx}, 0.5, {_dz})
send "&b&lTIDAL WAVE!" to player
# Water removal — runs every 20 ticks
on every 20 ticks:
loop {task::player::*}:
set {_task} to loop-index
set {_player} to {task::player::%_task%}
set {_wid} to {task::water::%_task%}
loop {waterblocks::%_player%::%_wid%::*}:
if block at loop-value is water:
set block at loop-value to air
delete {waterblocks::%_player%::%_wid%::*}
delete {task::player::%_task%}
delete {task::water::%_task%}
# Cooldown ticker — every second
on every 1 second:
loop all players:
if {cooldown::imbergem::%loop-player%} > 0:
subtract 1 from {cooldown::imbergem::%loop-player%}
if {cooldown::imbergem::%loop-player%} <= 0:
delete {cooldown::imbergem::%loop-player%}
send "&aYour Imber Gem tidal wave is ready!" to loop-player