Files
strengthsmp-s4-sword.sk
Code
1 442
strengthsmp-s4-sword.sk
# StrengthSMP Season 4 — Midas Sword Script
# Requires: Skript 2.12.2+, SkBee 3.16.1+
# Place in: plugins/Skript/scripts/
# Reload with: /sk reload strengthsmp-s4-sword
#
# ══════════════════════════════════════════════
# TEXTURE PACK SETUP GUIDE
# ══════════════════════════════════════════════
# This sword uses Custom Model Data to display
# a 3D model via a resource pack.
#
# FOLDER STRUCTURE inside your resource pack:
# assets/minecraft/models/item/
# netherite_sword.json ← override file
# midas_sword.json ← your 3D model file
# assets/minecraft/textures/item/
# midas_sword.png ← your texture (if needed)
# assets/minecraft/models/item/netherite_sword.json:
# {
# "parent": "item/handheld",
# "textures": { "layer0": "item/netherite_sword" },
# "overrides": [
# { "predicate": { "custom_model_data": 1001 }, "model": "item/midas_sword" }
# ]
# }
#
# Then in midas_sword.json, reference your 3D model
# (BlockBench export as "Item" type).
#
# The option below must match the custom_model_data
# value you set in netherite_sword.json (default: 1001)
# ══════════════════════════════════════════════
options:
# Sword Identity
sword_nbt_key: seasons_edge_s4
sword_nbt_value: strengthsmp_season4
# Custom Model Data (must match resource pack predicate value)
sword_model_data: 1001
# Cooldowns (seconds)
ability1_cooldown: 45
ability2_cooldown: 3600
# Ability 1 — Meteor Strike
meteor_radius: 5
# Ability 2 — Player Tracker
teleport_timer: 3
# Passive Effects (amplifier = level - 1, so 0 = level I)
speed_level: 0
strength_level: 0
resistance_level: 0
glowing_level: 0
effect_check_interval: 2
# Location Leak
location_leak_interval: 10800
location_leak_message: "&4&l[LOCATION LEAK] &c%owner% &7is holding &c&lSeason's Edge&7! Location: &f%world% &7(&f%x%&7, &f%y%&7, &f%z%&7)"
location_leak_unclaimed_message: "&4&l[LOCATION LEAK] &c&lSeason's Edge &7is lying unclaimed on the ground in &f%world% &7at &f%x%&7, &f%y%&7, &f%z%&7!"
# Prefix
prefix: &c&l[Season's Edge] &r
# ══════════════════════════════════════════════
# SWORD CREATION COMMAND (/midasword)
# ══════════════════════════════════════════════
command /midasword [<player>]:
permission: seasonsedge.give
permission message: &cYou do not have permission to use this command.
trigger:
if arg-1 is not set:
set {_target} to player
else:
set {_target} to arg-1
set {_sword} to a netherite sword named "&c&lSeason's Edge"
set lore of {_sword} to "&7&oThe blade of a fallen season.", "&7&oForged during &c&oStrengthSMP Season 4&7&o.", "", "&c&l✦ METEOR STRIKE &8— &7Shift + Left Click", "&5&l✦ PLAYER TRACKER &8— &7Shift + Right Click", "", "&8&oUnbreakable. Unstoppable. Yours."
set custom model data of {_sword} to {@sword_model_data}
set {_nbt} to nbt compound of {_sword}
set nbt tag "{@sword_nbt_key}" of {_nbt} to "{@sword_nbt_value}"
set {_sword} to item from nbt compound {_nbt}
give {_sword} to {_target}
send "{@prefix}&aThe sword has been given to &e%{_target}%&a." to player
send "{@prefix}&aYou have received &c&lSeason's Edge&a! Use it wisely." to {_target}
# ══════════════════════════════════════════════
# UTILITY — CHECK IF ITEM IS THE SWORD
# ══════════════════════════════════════════════
function isSeasonsEdge(i: item) :: boolean:
if {_i} is not set:
return false
if {_i} is air:
return false
set {_nbt} to nbt compound of {_i}
if nbt tag "{@sword_nbt_key}" of {_nbt} is "{@sword_nbt_value}":
return true
return false
# ══════════════════════════════════════════════
# UTILITY — CHECK IF PLAYER HAS SWORD IN INVENTORY
# ══════════════════════════════════════════════
function hasSwordInInventory(p: player) :: boolean:
loop items in inventory of {_p}:
if isSeasonsEdge(loop-item) is true:
return true
return false
# ══════════════════════════════════════════════
# UTILITY — GET SWORD SLOT INDEX
# ══════════════════════════════════════════════
function getSwordSlot(p: player) :: integer:
loop 36 times:
set {_slot} to loop-number - 1
set {_item} to slot {_slot} of inventory of {_p}
if isSeasonsEdge({_item}) is true:
return {_slot}
return -1
# ══════════════════════════════════════════════
# PASSIVE EFFECTS LOOP
# ══════════════════════════════════════════════
every {@effect_check_interval} seconds:
loop all players:
if hasSwordInInventory(loop-player) is true:
apply speed {@speed_level} to loop-player for 10 seconds
apply strength {@strength_level} to loop-player for 10 seconds
apply resistance {@resistance_level} to loop-player for 10 seconds
apply glowing {@glowing_level} to loop-player for 10 seconds
delete {sword.effects.removed::%loop-player%}
else:
if {sword.effects.removed::%loop-player%} is not set:
remove speed from loop-player
remove strength from loop-player
remove resistance from loop-player
remove glowing from loop-player
set {sword.effects.removed::%loop-player%} to true
# ══════════════════════════════════════════════
# RECONNECT — REAPPLY EFFECTS
# ══════════════════════════════════════════════
on join:
wait 1 second
if hasSwordInInventory(player) is true:
apply speed {@speed_level} to player for 10 seconds
apply strength {@strength_level} to player for 10 seconds
apply resistance {@resistance_level} to player for 10 seconds
apply glowing {@glowing_level} to player for 10 seconds
send "{@prefix}&aSeason's Edge detected. Passive effects applied." to player
# ══════════════════════════════════════════════
# SWORD PROTECTION — LAVA / VOID WARNING
# ══════════════════════════════════════════════
every 2 seconds:
loop all players:
if hasSwordInInventory(loop-player) is true:
if y-coordinate of loop-player < -64:
send "{@prefix}&cVoid detected! Protect your sword." to loop-player
if loop-player is in lava:
send "{@prefix}&cYou are in lava with Season's Edge! Get out!" to loop-player
# ══════════════════════════════════════════════
# GROUND ITEM PROTECTION — NEVER DESPAWN
# ══════════════════════════════════════════════
on item despawn:
if isSeasonsEdge(event-item) is true:
cancel event
# ══════════════════════════════════════════════
# TRACK DROP & PICKUP
# ══════════════════════════════════════════════
on drop of netherite sword:
wait 1 tick
if isSeasonsEdge(event-item) is true:
set {sword.ground.owner} to player
delete {sword.owner}
send "{@prefix}&eYou dropped &c&lSeason's Edge&e! It will never despawn." to player
on pickup of netherite sword:
if isSeasonsEdge(event-item) is true:
set {sword.owner} to player
delete {sword.ground.owner}
send "{@prefix}&aYou picked up &c&lSeason's Edge&a!" to player
# ══════════════════════════════════════════════
# GROUND PROTECTION — LAVA / VOID RETURN
# ══════════════════════════════════════════════
every 2 seconds:
loop all dropped items in all worlds: