sumitnoob38

make a minecraft script where if u die within the cube region of 0,57,0 and 302,164,302 , the players inventory gets cleared and the player goes in spectator mode where a actionbar appears and it says 'u died , respawing in 3 seconds' , make it a countdown from 3 to 1 second and then the player respanwns at 133,138,159 , make the action bar beautiful

Kodari AI
KodariJun 25 at 7:16 am 4

Iโ€™ll create a custom arena death handler with a beautiful countdown system.

ArenaDeathHandler
A custom death system for arena regions that intercepts player deaths within a defined cubic area. Features spectator mode transition, automatic inventory clearing, and a beautifully formatted actionbar countdown timer before respawning players at a designated spawn point. Perfect for PvP arenas, minigames, or custom survival zones requiring special death mechanics.

Installation Instructions:

  1. Place the file: Copy arena-death.sk to plugins/Skript/scripts/

  2. Load the script: Run /sk reload arena-death or restart the server

  3. Test it: Die within the region (X: 0-302, Y: 57-164, Z: 0-302)

Features:

  • โœจ Beautiful actionbar with skull emoji and formatting

  • ๐ŸŽฏ Precise region detection (cubic area)

  • ๐ŸŽ’ Complete inventory clearing (all slots + armor)

  • ๐Ÿ‘ป Spectator mode during countdown

  • โฑ๏ธ 3-second countdown with live updates

  • ๐Ÿ  Automatic respawn at coordinates (133, 138, 159)

  • ๐Ÿ”Š Sound effect on respawn

  • โค๏ธ Full health and hunger restoration

Customization:

  • Change region coordinates in the options section at the top

  • Modify respawn location (respawn-x, respawn-y, respawn-z)

  • Customize colors and text in the actionbar messages

  • Adjust countdown duration by changing the wait times

Kodari can make mistakes. Review important code before using.
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