Files
lightningblade.sk
Code
1 81
lightningblade.sk
# Zeus Sword - Custom Weapon System
# Author: Generated
# Version: 1.0
# Description: Netherite sword with max enchants and lightning strike ability
options:
prefix: &6[Zeus Sword]&r
sword-name: &6&lZeus Sword
lightning-damage: 6
hits-required: 10
lightning-chance: 10
on script load:
send "{@prefix} &aScript loaded successfully!" to console
# Command to obtain the Zeus Sword
command /zeussword:
permission: blade.get
aliases: /zeus, /getzeus
trigger:
# Create the sword with all enchantments
give player 1 netherite sword of sharpness 5 and unbreaking 3 and mending 1 and sweeping edge 3 and fire aspect 2 named "{@sword-name}" with lore "&7A legendary blade wielded by the gods" and "&7" and "&eSpecial Ability:" and "&7Every 10 hits: 10%% chance to strike" and "&7your target with divine lightning!" and "&7" and "&c⚔ &4Legendary Weapon &c⚔"
send "{@prefix} &aYou have received the Zeus Sword!" to player
send "{@prefix} &7Strike your enemies with the power of Zeus!" to player
# Track hits and trigger lightning ability
on damage:
attacker is a player
victim is set
attacker's tool is a netherite sword
uncolored name of attacker's tool contains "Zeus Sword":
# Increment hit counter for this player
add 1 to {blade.hits::%attacker%}
# Check if player has reached 10 hits
if {blade.hits::%attacker%} >= {@hits-required}:
# Reset counter
set {blade.hits::%attacker%} to 0
# 10% chance to trigger lightning
chance of {@lightning-chance}%:
# Strike lightning at victim location
strike lightning at victim
# Cancel the default lightning damage
wait 1 tick
heal victim by 100 hearts
# Deal controlled 3 hearts damage (6 HP)
damage victim by {@lightning-damage}
# Notify players
send "{@prefix} &e⚡ Your blade calls down divine lightning! &e⚡" to attacker
send "{@prefix} &c⚡ You were struck by lightning! &c⚡" to victim
# Play sound effects
play sound "entity.lightning_bolt.thunder" with volume 1 and pitch 1 at victim
play sound "entity.generic.explode" with volume 0.5 and pitch 1.5 at victim
# Admin command to reload the script
command /zeusreload:
permission: blade.admin
trigger:
send "{@prefix} &eReloading Zeus Sword script..." to player
send "{@prefix} &aUse /sk reload lightningblade to reload!" to player
# Admin command to clear hit counter
command /zeusclear [<offline player>]:
permission: blade.admin
trigger:
if arg-1 is set:
delete {blade.hits::%arg-1%}
send "{@prefix} &aCleared hit counter for %arg-1%!" to player
else:
delete {blade.hits::%player%}
send "{@prefix} &aCleared your hit counter!" to player
# Clean up data when player quits (optional - prevents data buildup)
on quit:
delete {blade.hits::%player%}