Files
mlot-magmy.sk
Code
1 66
mlot-magmy.sk
# Młot Magmy - Magma Hammer Weapon
# A powerful netherite axe with devastating abilities
# Version: 1.0
# For Minecraft 1.21.4
options:
prefix: &6[Młot Magmy]&r
cooldown: 120 # seconds
durability-damage: 75
item-name: &c&lMłot Magmy
# Command to obtain the Młot Magmy (OP only)
command /mlotmagmy:
permission: op
trigger:
give player 1 netherite axe of sharpness 6 named "{@item-name}"
send "{@prefix} &aOtrzymałeś Młot Magmy!" to player
# Special ability trigger on hit
on damage:
attacker is a player
victim is a player
attacker's tool is a netherite axe
name of attacker's tool is "{@item-name}"
# Check if player is on cooldown
if {mlotmagmy.cooldown::%attacker's uuid%} is set:
set {_diff} to difference between now and {mlotmagmy.cooldown::%attacker's uuid%}
if {_diff} is less than {@cooldown} seconds:
set {_remaining} to {@cooldown} - ({_diff} in seconds)
send "{@prefix} &cMusijesz poczekać jeszcze %{_remaining}% sekund!" to attacker
stop
# Activate ability - set cooldown
set {mlotmagmy.cooldown::%attacker's uuid%} to now
# Damage armor durability by 75 points
if victim's helmet is not air:
set victim's helmet's damage to (victim's helmet's damage + {@durability-damage})
if victim's chestplate is not air:
set victim's chestplate's damage to (victim's chestplate's damage + {@durability-damage})
if victim's leggings is not air:
set victim's leggings's damage to (victim's leggings's damage + {@durability-damage})
if victim's boots is not air:
set victim's boots's damage to (victim's boots's damage + {@durability-damage})
# Remove fire resistance effect
remove fire resistance from victim
# Create lava particle effect around victim
loop 40 times:
set {_x} to random number between -1.5 and 1.5
set {_y} to random number between 0 and 2.5
set {_z} to random number between -1.5 and 1.5
show 1 dripping lava particle at location of victim offset by {_x}, {_y}, {_z}
# Feedback messages
send "{@prefix} &a&lZdolność aktywowana! &7(Cooldown: {@cooldown}s)" to attacker
send "{@prefix} &c&lZostałeś uderzony Młotem Magmy!" to victim
# Script load confirmation
on script load:
send "{@prefix} &aMłot Magmy loaded successfully!" to console