Files
arena-death.sk
Code
1 73
arena-death.sk
# Arena Death Handler
# Handles custom death behavior in arena region
# Author: Kodari
# Version: 1.0
options:
# Region boundaries (cubic area)
region-x-min: 0
region-x-max: 302
region-y-min: 57
region-y-max: 164
region-z-min: 0
region-z-max: 302
# Respawn location coordinates
respawn-x: 133
respawn-y: 138
respawn-z: 159
# Beautiful actionbar formatting
skull: ๐
heart: โค
star: โฆ
on death:
# Get player's death coordinates
set {_x} to x-coordinate of player
set {_y} to y-coordinate of player
set {_z} to z-coordinate of player
# Check if player died within the arena region
if {_x} >= {@region-x-min}:
if {_x} <= {@region-x-max}:
if {_y} >= {@region-y-min}:
if {_y} <= {@region-y-max}:
if {_z} >= {@region-z-min}:
if {_z} <= {@region-z-max}:
# Player died in arena - trigger custom death sequence
cancel event
# Clear all inventory and equipment
clear inventory of player
clear helmet of player
clear chestplate of player
clear leggings of player
clear boots of player
# Heal and set to spectator mode
heal player
set player's food level to 20
set player's gamemode to spectator
# Beautiful countdown sequence - 3 seconds
send action bar "&8[&c{@skull}&8] &f&lYou died! &8| &6&lRespawning in &e&l3 &6&lseconds &8{@star}" to player
wait 1 second
# 2 seconds
send action bar "&8[&c{@skull}&8] &f&lYou died! &8| &6&lRespawning in &e&l2 &6&lseconds &8{@star}" to player
wait 1 second
# 1 second
send action bar "&8[&c{@skull}&8] &f&lYou died! &8| &6&lRespawning in &e&l1 &6&lsecond &8{@star}" to player
wait 1 second
# Respawn player at designated location
teleport player to location({@respawn-x}, {@respawn-y}, {@respawn-z}, world of player)
set player's gamemode to survival
heal player
set player's food level to 20
# Success message with beautiful formatting
send action bar "&8[&a{@heart}&8] &a&lโ You have respawned! &2Good luck! &8{@star}" to player
play sound "entity.player.levelup" with volume 0.5 and pitch 1.5 to player