Files
warden_heart.sk
Code
1 84
warden_heart.sk
# Warden Heart System
# Author: Generated
# Version: 1.0
# Description: Grants special buffs when holding the Warden Heart item
options:
# Item name that triggers the buffs (include color codes)
item-name: &1Warden Heart
# How often to check what players are holding (in seconds)
check-interval: 1 second
# Effect durations (slightly longer than check interval to avoid flickering)
effect-duration: 3 seconds
# Effect levels (1 = level I, 2 = level II, etc.)
strength-level: 2
resistance-level: 2
regeneration-level: 1
speed-level: 1
# Check every player's hand every second
every {@check-interval}:
loop all players:
set {_mainhand} to name of loop-player's tool
set {_offhand} to name of loop-player's off hand tool
if {_mainhand} is "{@item-name}":
apply_warden_buffs(loop-player)
else if {_offhand} is "{@item-name}":
apply_warden_buffs(loop-player)
# Function to apply all Warden Heart buffs
function apply_warden_buffs(p: player):
# Apply strength effect
apply strength {@strength-level} to {_p} for {@effect-duration}
# Apply resistance effect
apply resistance {@resistance-level} to {_p} for {@effect-duration}
# Apply regeneration effect
apply regeneration {@regeneration-level} to {_p} for {@effect-duration}
# Apply speed effect
apply speed {@speed-level} to {_p} for {@effect-duration}
# Apply night vision (longer duration to prevent flickering)
apply night vision 1 to {_p} for 10 seconds
# Admin command to give a Warden Heart to players
command /giveheart [<offline player>]:
permission: wardenheart.admin
permission message: &cYou don't have permission to use this command!
trigger:
if arg-1 is not set:
send "&6Usage: /giveheart <player>" to player
stop
if arg-1 is online:
set {_heart} to netherite upgrade smithing template named {@item-name}
set line 1 of lore of {_heart} to "&7A heart torn from the depths"
set line 2 of lore of {_heart} to "&7of the Deep Dark."
set line 3 of lore of {_heart} to ""
set line 4 of lore of {_heart} to "&6⚔ Grants powerful buffs when held"
set line 5 of lore of {_heart} to "&8Legendary Item"
give {_heart} to arg-1
send "&aGave Warden Heart to &e%arg-1%&a!" to player
send "&6You received a &1Warden Heart&6!" to arg-1
else:
send "&cThat player is not online!" to player
# Visual feedback when picking up the heart
on pick up:
set {_itemname} to name of item
if {_itemname} is "{@item-name}":
send "&6&lWARDEN HEART &7» &fYou feel immense power flowing through you..." to player
play sound "entity.warden.heartbeat" with volume 1 and pitch 1 at player
# Script load message
on script load:
send "&6[Warden Heart] &aScript loaded successfully!" to console
send "&7- Hold the &1Warden Heart &7to gain buffs" to console
send "&7- Use /giveheart <player> to give the item" to console