Hello can someone make/fix my code for custom ability? It should play entity.warden.sonic_boom , make warden sonic boom that damages entities, command that gives the wand (optional). I'm not very good so my code can be bad.. I'm on paper 1.21.11, skript 2.14.2, and have skBee, skRayFall, skonic, skvoid
this is my code:
command /wardenstaff:
permission: op
trigger:
give player blaze rod named "<##00ffff>Warden Staff"
set byte tag "minecraft:custom_data;wardenstaff" of nbt of player's tool to 1
send "&7You received the &bWarden Staff&7." to player
# Ability (right click)
on right click:
set {_tool} to player's tool
if {_tool} is air:
stop
if byte tag "minecraft:custom_data;wardenstaff" of nbt of {_tool} is not 1:
stop
set {_uuid} to uuid of player
if {warden::cooldown::%{_uuid}%} is set:
set {_time} to difference between {warden::cooldown::%{_uuid}%} and now
if {_time} > 0 seconds:
set {_sec} to floor({_time} parsed as number)
send action bar "&cCooldown: %{_sec}%s" to player
stop
else:
delete {warden::cooldown::%{_uuid}%}
set {_loc} to eye location of player
loop 20 times:
set {_loc} to location 1 meter in front of {_loc}
make 3 of sculk_charge using 0.1 at {_loc} with force
draw 2 of dust using dustOption(cyan, 1) at {_loc}
loop all living entities:
if loop-entity is not player:
if distance between loop-entity and {_loc} <= 1.2:
damage loop-entity by 8
play "entity_warden_sonic_boom" to player at volume 1
set {warden::cooldown::%{_uuid}%} to now + 30 seconds
every 1 second:
loop all players:
set {_tool} to loop-player's tool
if {_tool} is air:
stop loop
if byte tag "minecraft:custom_data;wardenstaff" of nbt of {_tool} is not 1:
stop loop
set {_uuid} to uuid of loop-player
if {warden::cooldown::%{_uuid}%} is set:
set {_time} to difference between {warden::cooldown::%{_uuid}%} and now
if {_time} > 0 seconds:
set {_sec} to floor({_time} parsed as number)
send action bar "&bSonic Boom CD: &f%{_sec}%s" to loop-player
else:
delete {warden::cooldown::%{_uuid}%}
send action bar "&aSonic Boom Ready" to loop-player
else:
send action bar "&aSonic Boom Ready" to loop-player
this is my code:
command /wardenstaff:
permission: op
trigger:
give player blaze rod named "<##00ffff>Warden Staff"
set byte tag "minecraft:custom_data;wardenstaff" of nbt of player's tool to 1
send "&7You received the &bWarden Staff&7." to player
# Ability (right click)
on right click:
set {_tool} to player's tool
if {_tool} is air:
stop
if byte tag "minecraft:custom_data;wardenstaff" of nbt of {_tool} is not 1:
stop
set {_uuid} to uuid of player
if {warden::cooldown::%{_uuid}%} is set:
set {_time} to difference between {warden::cooldown::%{_uuid}%} and now
if {_time} > 0 seconds:
set {_sec} to floor({_time} parsed as number)
send action bar "&cCooldown: %{_sec}%s" to player
stop
else:
delete {warden::cooldown::%{_uuid}%}
set {_loc} to eye location of player
loop 20 times:
set {_loc} to location 1 meter in front of {_loc}
make 3 of sculk_charge using 0.1 at {_loc} with force
draw 2 of dust using dustOption(cyan, 1) at {_loc}
loop all living entities:
if loop-entity is not player:
if distance between loop-entity and {_loc} <= 1.2:
damage loop-entity by 8
play "entity_warden_sonic_boom" to player at volume 1
set {warden::cooldown::%{_uuid}%} to now + 30 seconds
every 1 second:
loop all players:
set {_tool} to loop-player's tool
if {_tool} is air:
stop loop
if byte tag "minecraft:custom_data;wardenstaff" of nbt of {_tool} is not 1:
stop loop
set {_uuid} to uuid of loop-player
if {warden::cooldown::%{_uuid}%} is set:
set {_time} to difference between {warden::cooldown::%{_uuid}%} and now
if {_time} > 0 seconds:
set {_sec} to floor({_time} parsed as number)
send action bar "&bSonic Boom CD: &f%{_sec}%s" to loop-player
else:
delete {warden::cooldown::%{_uuid}%}
send action bar "&aSonic Boom Ready" to loop-player
else:
send action bar "&aSonic Boom Ready" to loop-player