Files
EndFightTracker.sk
GlitchedName.sk
JuggernautEvent.sk
Code
3 158
EndFightTracker.sk
# EndFightTracker.sk
# Tracks the Dragon Egg and grants special powers to its holder
# Place in plugins/Skript/scripts/ and run /sk reload EndFightTracker
options:
prefix: &6[EndFight]&r
# ============================================
# Dragon Egg Pickup - Announce + Give Mace
# ============================================
on pickup of dragon egg:
# Clear old holder's mace if they exist (different player)
if {dragon_egg_holder} is set:
if {dragon_egg_holder} is online:
if {dragon_egg_holder} is not player:
remove all maces from {dragon_egg_holder}'s inventory
clear {dragon_egg_holder}'s potion effects
# Set new holder
set {dragon_egg_holder} to player
broadcast "&e%player% &6has the Dragon Egg!"
remove all maces from player's inventory
set {_m} to mace named "&5Dragon's Wrath" with lore "&7The power of the Enderdragon lies within..."
add curse of vanishing to {_m}
give {_m} to player
# ============================================
# Holder Dies - Remove Mace, Clear Holder
# ============================================
on death of player:
if {dragon_egg_holder} is victim:
broadcast "&e%victim% &6died and lost the Dragon Egg!"
remove all maces from victim's inventory
clear victim's potion effects
delete {dragon_egg_holder}
# ============================================
# Prevent Dropping the Dragon Egg or Dragon's Wrath Mace
# ============================================
on drop of dragon egg:
if {dragon_egg_holder} is player:
cancel event
send "{@prefix} &cYou cannot drop the Dragon Egg!" to player
on drop of mace:
if name of dropped item is "&5Dragon's Wrath":
cancel event
send "{@prefix} &cYou cannot drop the Dragon's Wrath!" to player
# ============================================
# Continuous Effect Application (every 2 seconds)
# ============================================
every 2 seconds:
if {dragon_egg_holder} is set:
if {dragon_egg_holder} is online:
# Check if holder still has the Dragon Egg
if {dragon_egg_holder}'s inventory does not contain dragon egg:
broadcast "&e%{dragon_egg_holder}% &6no longer has the Dragon Egg — powers revoked!"
remove all maces from {dragon_egg_holder}'s inventory
clear {dragon_egg_holder}'s potion effects
delete {dragon_egg_holder}
stop
# Apply effects
apply speed 1 to {dragon_egg_holder} for 4 seconds
apply strength 2 to {dragon_egg_holder} for 4 seconds
# Anti-Dupe: Remove any extra maces from inventory
set {_mace_count} to amount of mace named "&5Dragon's Wrath" in {dragon_egg_holder}'s inventory
if {_mace_count} > 1:
remove 1 mace named "&5Dragon's Wrath" from {dragon_egg_holder}'s inventory
# ============================================
# Anti-Dupe: Clean up any maces on the ground
# ============================================
every 5 seconds:
loop all dropped items:
if loop-value is mace:
if name of loop-value is "&5Dragon's Wrath":
delete loop-value
# ============================================
# Prevent putting Dragon Egg or Mace into any container
# ============================================
on inventory click:
if {dragon_egg_holder} is player:
# Check if clicking the Dragon's Wrath into a container
if event-item is mace:
if name of event-item is "&5Dragon's Wrath":
if event-inventory is not player's inventory:
cancel event
send "{@prefix} &cYou cannot store the Dragon's Wrath in containers!" to player
# Check if clicking the Dragon Egg into a container
if event-item is dragon egg:
if event-inventory is not player's inventory:
cancel event
send "{@prefix} &cYou cannot store the Dragon Egg in containers!" to player