xyv3n.

see this? this is kinda good but i want it to be netherite spear and the "dash spear" name doesnt sound too cool SO §x§0§0§C§1§F§F§oD§x§0§3§B§7§F§0§oa§x§0§5§A§C§E§2§os§x§0§8§A§2§D§3§oh §x§0§D§8§D§B§6§oS§x§1§0§8§3§A§8§op§x§1§3§7§9§9§9§oe§x§1§5§6§E§8§B§oa§x§1§8§6§4§7§C§or use this name and change it to netherite

📎 1 file 2,775 chars
📄
pasted-code-1782575504609.txt
txt 64 lines
▶
# ----------------------------------------------------
# 2-CHARGE DASH SHOVEL SKRIPT (SHIFT + RIGHT CLICK)
# ----------------------------------------------------

command /getspear:
    permission: op
    trigger:
        give 1 wooden spear named "&b&lDash Spear" with lore "&7Sneak and right-click to dash! (2 Charges)" to player

# Background manager: Automatically restores charges over time
every 5 seconds:
    loop all players:
        # If they are missing charges, give one back
        if {spear::charges::%uuid of loop-player%} is less than 2:
            # Initialize if variable is empty
            if {spear::charges::%uuid of loop-player%} is not set:
                set {spear::charges::%uuid of loop-player%} to 2
                stop
            add 1 to {spear::charges::%uuid of loop-player%}
            send action bar "&b&l⚡ Dash Restored! &7(%{spear::charges::%uuid of loop-player%}%/2)" to loop-player

on right click:
    # Look for the exact name: Dash Spear
    if name of player's tool is "&b&lDash Spear":
        if player is sneaking:
            cancel event
            
            # Setup charges if it's the player's first time using it
            if {spear::charges::%uuid of player%} is not set:
                set {spear::charges::%uuid of player%} to 2
                
            # Check if they have any charges available
            if {spear::charges::%uuid of player%} is less than 1:
                send action bar "&c&l[!] &7Out of dashes! Wait for a recharge." to player
                stop
                
            # Consume 1 dash charge
            subtract 1 from {spear::charges::%uuid of player%}
            
            # Display current charge count dynamically
            send action bar "&b&l💨 Dash Used! &7(%{spear::charges::%uuid of player%}%/2)" to player
                
            # Launch forces
            push player forward with velocity 2.5
            push player upward with velocity 0.6
            
            # Set the bypass flag for fall damage
            set {spear::nodamage::%uuid of player%} to true
            
            # Sound effects
            play sound "entity.wither.shoot" with volume 0.7 and pitch 1.2 to player
            play sound "entity.dragon_fireball.explode" with volume 0.4 and pitch 1.8 to player

# Cancel fall damage on landing
on damage of player:
    if damage cause is fall:
        if {spear::nodamage::%uuid of victim%} is true:
            cancel event
            clear {spear::nodamage::%uuid of victim%}
            
# Clean up data when a player leaves to prevent memory leaks
on quit:
    clear {spear::charges::%uuid of player%}
    clear {spear::nodamage::%uuid of player%}
xyv3n.

see this? this is kinda good but i want it to be netherite spear and the "dash spear" name doesnt sound too cool SO §x§0§0§C§1§F§F§oD§x§0§3§B§7§F§0§oa§x§0§5§A§C§E§2§os§x§0§8§A§2§D§3§oh §x§0§D§8§D§B§6§oS§x§1§0§8§3§A§8§op§x§1§3§7§9§9§9§oe§x§1§5§6§E§8§B§oa§x§1§8§6§4§7§C§or use this name and change it to netherite

Kodari can make mistakes. Review important code before using.
Files

No files in this session

Code