Files
strength_greed.sk
Code
1 40
strength_greed.sk
options:
prefix: &4[Strength Greed]
sword-name: &4sᴛʀᴇɴɢᴛʜ ɢʀᴇᴇᴅ
cooldown: 25
on script load:
send "{@prefix} &aLoaded successfully!" to console
command /strengthgreed:
permission: strengthgreed.give
trigger:
give player 1 netherite sword named "{@sword-name}" with lore "&7Shift + Right Click to activate" and "&cSacrifice 2 hearts for power"
send "{@prefix} &aYou received the Strength Greed sword!" to player
on right click:
if player is sneaking:
if name of player's tool is "{@sword-name}":
if {strengthgreed.cooldown::%player%} is set:
set {_remaining} to difference between {strengthgreed.cooldown::%player%} and now
send "{@prefix} &cCooldown: %{_remaining}% remaining!" to player
stop
set {_currenthealth} to player's health
if {_currenthealth} <= 4:
send "{@prefix} &cNot enough health! You need more than 2 hearts." to player
stop
set {_newhealth} to {_currenthealth} - 4
set player's health to {_newhealth}
apply strength 1 to player for 20 seconds
send "{@prefix} &aYou sacrificed 2 hearts for &lSTRENGTH&a!" to player
play sound "entity.wither.hurt" with volume 1 and pitch 1.5 at player
set {strengthgreed.cooldown::%player%} to {@cooldown} seconds from now
wait {@cooldown} seconds
delete {strengthgreed.cooldown::%player%}