Files
godshovel.sk
Code
1 107
godshovel.sk
# God Shovel
# A legendary wooden shovel with god-like powers
# Paper 1.21.1
# Place in plugins/Skript/scripts/ and use /sk reload godshovel
options:
prefix: "&8[&6✦GodShovel&8]"
# ======================== ITEM DEFINITION ========================
function getGodShovel() :: item:
set {_i} to wooden shovel named "&6&lGod Shovel"
set lore of {_i} to "&7A legendary shovel blessed by the gods", "&7Forged with wither souls and ominous keys", "", "&c⚔ Breaks shields & deals sword damage", "&b⛏ Mines any block with incredible speed", "&d⚡ Grants Speed II, Haste VIII & Strength II", "&e☄ Deals bonus fall damage like a mace"
add efficiency 10 and unbreaking 10 to {_i}
return {_i}
# ======================== CRAFTING RECIPE ========================
# Recipe:
# Wither Skull | Ominous Key | Wither Skull
# Ench Apple | Wooden Shovel | Ench Apple
# Wither Skull | Ominous Key | Wither Skull
on script load:
set {_item} to getGodShovel()
add shaped recipe for {_item}:
matrix:
"SKS"
"EGE"
"SKS"
ingredients:
S = wither skeleton skull
K = ominous key
E = enchanted golden apple
G = wooden shovel
# ======================== PASSIVE EFFECTS ========================
every 3 seconds:
loop all players:
set {_tool} to tool of loop-player
if {_tool} is set:
if name of {_tool} is "&6&lGod Shovel":
apply speed 2 to loop-player for 4 seconds
apply haste 8 to loop-player for 4 seconds
apply strength 2 to loop-player for 4 seconds
# ======================== COMBAT SYSTEM ========================
on damage of a player:
if attacker is a player:
set {_tool} to tool of attacker
if {_tool} is set:
if name of {_tool} is "&6&lGod Shovel":
set damage to 8
if fall distance of attacker > 2:
set {_bonus} to round(fall distance of attacker * 1.75)
add {_bonus} to damage
if victim is blocking:
set {_shield} to offhand item of victim
set offhand of victim to air
drop {_shield} at victim
send "{@prefix}&cYour shield was shattered!" to victim
send "{@prefix}&6The God Shovel shattered their shield!" to attacker
# ======================== TOOL SYSTEM ========================
on mine:
set {_tool} to player's tool
if {_tool} is set:
if name of {_tool} is "&6&lGod Shovel":
cancel event
set {_loc} to location of event-block
set {_type} to type of event-block
set event-block to air
play break effect at {_loc}
if {_type} is iron ore or {_type} is deepslate iron ore:
set {_count} to random integer between 1 and 3
drop {_count} raw iron at {_loc}
else if {_type} is gold ore or {_type} is deepslate gold ore:
set {_count} to random integer between 1 and 3
drop {_count} raw gold at {_loc}
else if {_type} is diamond ore or {_type} is deepslate diamond ore:
drop 1 diamond at {_loc}
else if {_type} is emerald ore or {_type} is deepslate emerald ore:
drop 1 emerald at {_loc}
else if {_type} is lapis ore or {_type} is deepslate lapis ore:
set {_count} to random integer between 4 and 9
drop {_count} lapis lazuli at {_loc}
else if {_type} is redstone ore or {_type} is deepslate redstone ore:
set {_count} to random integer between 4 and 5
drop {_count} redstone at {_loc}
else if {_type} is nether gold ore:
set {_count} to random integer between 2 and 6
drop {_count} gold nugget at {_loc}
else if {_type} is nether quartz ore:
set {_count} to random integer between 1 and 2
drop {_count} nether quartz at {_loc}
else if {_type} is copper ore or {_type} is deepslate copper ore:
set {_count} to random integer between 2 and 5
drop {_count} raw copper at {_loc}
else if {_type} is coal ore or {_type} is deepslate coal ore:
drop 1 coal at {_loc}
else if {_type} is ancient debris:
drop 1 ancient debris at {_loc}
else:
drop {_type} at {_loc}