Files
magma-hammer.sk
Code
1 106
magma-hammer.sk
# Młot Magmy (Magma Hammer)
# Author: Generated
# Version: 1.0
# MC Version: 1.21.4
#
# Features:
# - Netherite axe with Sharpness 6
# - 120 second cooldown ability
# - Breaks 75 armor durability on hit
# - Disables fire resistance
# - Spawns lava particles around victim
# - OP-only command to obtain
options:
prefix: &6[Młot Magmy]&r
weapon-name: &c&lMłot Magmy
cooldown: 120 # seconds
durability-damage: 75
particle-duration: 3 # seconds
particle-amount: 50
# Command to get the Młot Magmy
command /mlotmagmy:
permission: op
permission message: &cOnly operators can use this command!
trigger:
give player 1 netherite axe of sharpness 6 named "{@weapon-name}" with lore "&7Legendarny topór magmy" and "&7Zdolność: Erupcja (120s cooldown)" and "&c▪ Niszczy pancerz" and "&c▪ Usuwa odporność na ogień" and "&c▪ Wyzwala lawe"
send "{@prefix} &aOtrzymałeś Młot Magmy!" to player
play sound "block.anvil.use" with volume 1 and pitch 1.2 at player
# Handle the special attack
on damage:
attacker is a player
victim is a player or mob
attacker's tool is netherite axe
name of attacker's tool is "{@weapon-name}"
# Check if player is on cooldown
if {mlotmagmy.cooldown::%attacker's uuid%} is set:
set {_remaining} to difference between {mlotmagmy.cooldown::%attacker's uuid%} and now
if {_remaining} is more than 0 seconds:
set {_seconds} to {_remaining} in seconds
send "{@prefix} &cKooldown: &e%{_seconds}%s" to attacker
stop
# Apply the special ability
send "{@prefix} &6⚡ ERUPCJA MAGMY!" to attacker
send "{@prefix} &cZostałeś trafiony Młotem Magmy!" to victim
# Set cooldown
set {mlotmagmy.cooldown::%attacker's uuid%} to {@cooldown} seconds from now
# Play sound effects
play sound "entity.generic.explode" with volume 1 and pitch 0.8 at victim
play sound "block.lava.pop" with volume 1 and pitch 0.5 at victim
# Remove fire resistance from victim
if victim has fire resistance:
remove fire resistance from victim
send "&c✖ Twoja odporność na ogień została usunięta!" to victim
# Apply fire effect
ignite victim for 5 seconds
# Damage armor durability
if victim is a player:
set {_helmet} to victim's helmet
set {_chestplate} to victim's chestplate
set {_leggings} to victim's leggings
set {_boots} to victim's boots
# Damage each armor piece (split 75 durability across all pieces)
set {_damage} to round({@durability-damage} / 4)
if {_helmet} is set:
damage {_helmet} by {_damage}
if {_chestplate} is set:
damage {_chestplate} by {_damage}
if {_leggings} is set:
damage {_leggings} by {_damage}
if {_boots} is set:
damage {_boots} by {_damage}
send "&c⚠ Twój pancerz został uszkodzony!" to victim
# Spawn lava particles around victim
loop {@particle-duration} times:
wait 1 second
loop {@particle-amount} times:
set {_x} to random number between -1.5 and 1.5
set {_y} to random number between 0 and 2
set {_z} to random number between -1.5 and 1.5
set {_loc} to location of victim
add {_x} to x-coordinate of {_loc}
add {_y} to y-coordinate of {_loc}
add {_z} to z-coordinate of {_loc}
play particle lava at {_loc} for all players
play particle flame at {_loc} for all players
# Clear cooldown on player quit (optional - remove if you want cooldown to persist)
on quit:
delete {mlotmagmy.cooldown::%player's uuid%}
# Script load message
on script load:
send "{@prefix} &aScript loaded successfully!" to console
send "&7Version: 1.0 | MC 1.21.4" to console