newger12
๐Ÿ“Ž 1 file 3,454 chars
๐Ÿ“„
gemini-code-1790595656665.txt
txt 71 lines
โ–ถ
# ============================================
# Custom Wither Shard & Explosive Mace Script
# ============================================

# Define custom items & recipes on server load
on load:
    # ----------------------------------------
    # 1. Custom Item Definition: Wither Shard
    # ----------------------------------------
    set {_wither_shard} to amethyst shard named "&5&lWither Shard"
    set line 1 of lore of {_wither_shard} to "&7A dark, pulsating crystal."
    set line 2 of lore of {_wither_shard} to "&7Used to craft volatile weapons."
    
    # Recipe: 4 Amethyst Shards + 4 Wither Skeleton Skulls -> Wither Shard
    # Layout:
    # [Amethyst Shard] [Wither Skull] [Amethyst Shard]
    # [Wither Skull  ] [            ] [Wither Skull  ]
    # [Amethyst Shard] [Wither Skull] [Amethyst Shard]
    register new shaped recipe for {_wither_shard} using amethyst shard, wither skeleton skull, amethyst shard, wither skeleton skull, air, wither skeleton skull, amethyst shard, wither skeleton skull, amethyst shard with id "wither_shard_recipe"

    # ----------------------------------------
    # 2. Custom Weapon: Explosive Mace
    # ----------------------------------------
    set {_mace} to mace named "&d&lExplosive Wither Mace"
    set line 1 of lore of {_mace} to "&7Right-click to launch an explosive dash."
    set line 2 of lore of {_mace} to "&7Fall impact creates a massive explosion."

    # Recipe: 4 Wither Shards, 1 Heavy Core, 1 Breeze Rod -> Explosive Mace
    # Layout:
    # [Wither Shard] [Heavy Core  ] [Wither Shard]
    # [Wither Shard] [Breeze Rod  ] [Wither Shard]
    # [    Air     ] [    Air     ] [    Air     ]
    register new shaped recipe for {_mace} using {_wither_shard}, heavy core, {_wither_shard}, {_wither_shard}, breeze rod, {_wither_shard}, air, air, air with id "explosive_mace_recipe"

# --------------------------------------------
# Right-Click Mace: Explosive Dash Mechanics
# --------------------------------------------
on right click holding mace:
    name of player's tool contains "Explosive Wither Mace"
    
    # Cooldown check (3 seconds)
    set {_waited} to difference between {mace_cooldown::%player's uuid%} and now
    if {_waited} is less than 3 seconds:
        set {_remaining} to 3 seconds - {_waited}
        send "&cDash on cooldown! Wait %{_remaining}%." to player
        stop

    set {mace_cooldown::%player's uuid%} to now

    # Launch player forward and upward
    push player forward at speed 2.5
    push player upward at speed 1.2
    
    # Sound & visual explosion effect at launch point
    play sound "entity.wind_charge.wind_burst" with volume 1.5 and pitch 0.8 at player
    play sound "entity.wither.shoot" with volume 0.8 and pitch 1.2 at player
    draw 20 large smoke particles at player's location
    create a fake explosion at player's location

# --------------------------------------------
# Fall Impact: Explosive Smash & Damage Cancel
# --------------------------------------------
on damage of player:
    damage cause is fall
    name of victim's tool contains "Explosive Wither Mace"
    cancel event # Negate fall damage

    # Create real explosion impact (force 2.5) at landing spot
    create an explosion of force 2.5 at location of victim
    play sound "entity.generic.explode" with volume 1.5 and pitch 0.9 at location of victim
    play sound "entity.wither.break_block" with volume 1.0 and pitch 0.8 at location of victim
Kodari AI
KodariSep 28 at 11:41 am 1
WitherMaceCombat
Creates a custom Wither Shard crafting item and Explosive Wither Mace weapon with shaped recipes. Implements a right-click dash ability with a 3-second cooldown, launching the player forward with visual and audio effects. Fall damage is negated when holding the mace, triggering a powerful explosion at the landing location with force 2.5 and dramatic sound effects. Includes custom item lore, particle effects, and cooldown messaging for an engaging combat experience.

Place explosive_wither_mace.sk in plugins/Skript/scripts/, then run /sk reload explosive_wither_mace. Install SkBee for the shaped recipes.

Kodari can make mistakes. Review important code before using.
Files
explosive_wither_mace.sk
Code
1 56
explosive_wither_mace.sk
# Requires Skript and SkBee for shaped recipe registration.

options:
    dash-cooldown: 3 seconds
    dash-window: 10 seconds

on load:
    set {_wither_shard} to amethyst shard named "&5&lWither Shard"
    set line 1 of lore of {_wither_shard} to "&7A dark, pulsating crystal."
    set line 2 of lore of {_wither_shard} to "&7Used to craft volatile weapons."

    register new shaped recipe for {_wither_shard} using amethyst shard, wither skeleton skull, amethyst shard, wither skeleton skull, air, wither skeleton skull, amethyst shard, wither skeleton skull, amethyst shard with id "wither_shard_recipe"

    set {_mace} to mace named "&d&lExplosive Wither Mace"
    set line 1 of lore of {_mace} to "&7Right-click to launch an explosive dash."
    set line 2 of lore of {_mace} to "&7Fall impact creates a massive explosion."

    register new shaped recipe for {_mace} using {_wither_shard}, heavy core, {_wither_shard}, {_wither_shard}, breeze rod, {_wither_shard}, air, air, air with id "explosive_mace_recipe"

on right click:
    if name of player's tool is not "&d&lExplosive Wither Mace":
        stop

    if {mace_cooldown::%uuid of player%} is set:
        set {_elapsed} to difference between now and {mace_cooldown::%uuid of player%}
        if {_elapsed} is less than {@dash-cooldown}:
            set {_remaining} to {@dash-cooldown} - {_elapsed}
            send "&cDash on cooldown! Wait %{_remaining}%." to player
            stop

    set {mace_cooldown::%uuid of player%} to now
    set {mace_dash::%uuid of player%} to now

    push player in direction of player at speed 2.5
    push player upwards at speed 1.2

    play sound "entity.wind_charge.wind_burst" with volume 1.5 and pitch 0.8 at player
    play sound "entity.wither.shoot" with volume 0.8 and pitch 1.2 at player
    play effect explosion at location of player

on damage of player:
    if damage cause is not fall:
        stop
    if {mace_dash::%uuid of victim%} is not set:
        stop

    if difference between now and {mace_dash::%uuid of victim%} is greater than {@dash-window}:
        delete {mace_dash::%uuid of victim%}
        stop

    cancel event
    delete {mace_dash::%uuid of victim%}

    create an explosion of force 2.5 at location of victim
    play sound "entity.generic.explode" with volume 1.5 and pitch 0.9 at location of victim
    play sound "entity.wither.break_block" with volume 1.0 and pitch 0.8 at location of victim