Hdhehhh Hdhh

add new cooler effects and more jsut add more things and colloer more complex things

๐Ÿ“Ž 1 file 4,791 chars
๐Ÿ“„
pasted-code-1793376823641.txt
txt 120 lines
โ–ถ
# ============================================================
#  Magic Arrow - right click with a sword
#  1. Fires a glowing arrow with a particle trail
#  2. On impact: block displays spin around the hit point,
#     getting faster and tighter, then burst out in random
#     directions.
#
#  Needs: Skript 2.10+ (native display entities) on Paper 1.20.4+
#  Put this file in plugins/Skript/scripts/ then /sk reload magic_arrow
# ============================================================

options:
    cooldown: 15 ticks
    blocks: 14              # how many block displays
    spin-ticks: 40          # how long the spin-in lasts
    burst-ticks: 25         # how long the burst flies

on right click:
    "%type of player's tool%" contains "sword"
    if {-magicarrow::%uuid of player%} is set:
        stop
    set {-magicarrow::%uuid of player%} to true

    set {_eye} to location of player's head
    spawn an arrow at {_eye}
    set {_a} to last spawned entity
    set shooter of {_a} to player
    add "magic_arrow" to scoreboard tags of {_a}
    set gravity of {_a} to false
    set velocity of {_a} to (vector from yaw (yaw of player) and pitch (pitch of player)) * 3
    play sound "entity.blaze.shoot" with volume 1 with pitch 1.6 at player

    # cooldown release
    set {_uuid} to uuid of player
    wait {@cooldown}
    delete {-magicarrow::%{_uuid}%}

    # particle trail (max 5 seconds, then the arrow disappears)
    loop 100 times:
        if {_a} is not valid:
            stop
        draw 2 of end rod at location of {_a}
        draw 3 of electric spark at location of {_a}
        draw 1 of witch at location of {_a}
        wait 1 tick
    if {_a} is valid:
        delete {_a}

on projectile hit:
    scoreboard tags of projectile contains "magic_arrow"
    set {_loc} to location of projectile
    delete projectile
    magicBlast({_loc})

function magicBlast(loc: location):
    set {_c} to {_loc} ~ vector(0, 1, 0)

    # --- impact flash ---
    draw 40 of firework at {_c}
    draw 1 of explosion emitter at {_c}
    play sound "entity.generic.explode" with volume 1 with pitch 1.3 at {_c}
    play sound "block.beacon.activate" with volume 1 with pitch 2 at {_c}

    # --- summon the block displays ---
    set {_mats::*} to magma block, crying obsidian, amethyst block, glowstone, purple concrete, sea lantern, shroomlight
    loop {@blocks} times:
        set {_i} to loop-number
        spawn a block display at {_c}
        set {_d::%{_i}%} to last spawned entity
        set display block data of {_d::%{_i}%} to random element of {_mats::*}
        set transformation scale of {_d::%{_i}%} to vector(0.4, 0.4, 0.4)
        set {_off::%{_i}%} to (360 / {@blocks}) * {_i}

    # --- phase 1: spin around the center, faster and tighter ---
    set {_angle} to 0
    loop {@spin-ticks} times:
        set {_p} to loop-number / {@spin-ticks}
        set {_r} to 4 - (3.4 * {_p})
        set {_angle} to {_angle} + 6 + (50 * {_p} * {_p})
        loop {@blocks} times:
            set {_i} to loop-number
            set {_a} to {_angle} + {_off::%{_i}%}
            set {_y} to sin({_angle} * 0.7 + ({_i} * 40)) * 0.6
            set {_pos} to {_c} ~ vector(cos({_a}) * {_r}, {_y}, sin({_a}) * {_r})
            teleport {_d::%{_i}%} to {_pos} ~ vector(-0.2, -0.2, -0.2)
            draw 1 of end rod at {_pos}
            draw 1 of soul fire flame at {_pos}
        if mod(loop-number, 5) = 0:
            play sound "block.amethyst_block.chime" with volume 0.7 with pitch (0.5 + {_p} * 1.5) at {_c}
        wait 1 tick

    # --- phase 2: random burst in every direction ---
    play sound "entity.firework_rocket.blast" with volume 1.5 with pitch 0.8 at {_c}
    draw 60 of flame at {_c}
    loop {@blocks} times:
        set {_i} to loop-number
        set {_yaw} to random number between 0 and 360
        set {_pitch} to random number between -50 and 80
        set {_spd} to random number between 0.5 and 1.4
        set {_v::%{_i}%} to vector(cos({_yaw}) * cos({_pitch}), sin({_pitch}), sin({_yaw}) * cos({_pitch})) * {_spd}
        set {_pp::%{_i}%} to {_c}
        set {_a} to {_angle} + {_off::%{_i}%}
        set {_pp::%{_i}%} to {_c} ~ vector(cos({_a}) * 0.6, 0, sin({_a}) * 0.6)

    loop {@burst-ticks} times:
        loop {@blocks} times:
            set {_i} to loop-number
            subtract 0.03 from y component of {_v::%{_i}%}
            set {_pp::%{_i}%} to {_pp::%{_i}%} ~ {_v::%{_i}%}
            teleport {_d::%{_i}%} to {_pp::%{_i}%} ~ vector(-0.2, -0.2, -0.2)
            draw 1 of flame at {_pp::%{_i}%}
            draw 1 of smoke at {_pp::%{_i}%}
        wait 1 tick

    # --- cleanup ---
    loop {@blocks} times:
        set {_i} to loop-number
        draw 8 of poof at {_pp::%{_i}%}
        delete {_d::%{_i}%}
Kodari AI
KodariOct 30 at 4:17 pm 1
MagicArrowOverhaul
An advanced Minecraft Skript that enhances the Magic Arrow projectile system with more complex visual effects. Right-clicking with a sword fires a glowing arrow with particle trails. On impact, it creates a stunning display featuring multiple phases: a rapid spinning vortex of block displays that accelerates and tightens, followed by a chaotic burst of blocks scattering in random directions with gravity physics. The system includes enhanced particle effects, dynamic sound design with pitch variations, multiple block material types, and a cooldown system. Features improved visual complexity through synchronized spinning animations, layered particle effects including end rods, soul fire, flames, and smoke, plus randomized burst trajectories for unpredictable and spectacular results.
Kodari can make mistakes. Review important code before using.
Files
magic_arrow.sk
Code
1 151
magic_arrow.sk
# Magic Arrow: right-click with a sword to unleash a particle-rich block-display burst.
# Requires Skript 2.10+ on Paper 1.20.4+.
# Place in plugins/Skript/scripts/ and run /sk reload magic_arrow.

options:
    cooldown: 15 ticks
    blocks: 18
    spin-ticks: 48
    burst-ticks: 32

on right click:
    "%type of player's tool%" contains "sword"
    if {-magicarrow::%uuid of player%} is set:
        stop
    set {-magicarrow::%uuid of player%} to true

    set {_eye} to location of player's head
    spawn an arrow at {_eye}
    set {_a} to last spawned entity
    set shooter of {_a} to player
    add "magic_arrow" to scoreboard tags of {_a}
    set gravity of {_a} to false
    set velocity of {_a} to (vector from yaw (yaw of player) and pitch (pitch of player)) * 3
    play sound "entity.blaze.shoot" with volume 1 with pitch 1.6 at player
    play sound "block.amethyst_block.chime" with volume 0.6 with pitch 1.8 at player

    set {_uuid} to uuid of player
    wait {@cooldown}
    delete {-magicarrow::%{_uuid}%}

    loop 100 times:
        if {_a} is not valid:
            stop
        set {_trailAngle} to loop-number * 24
        set {_trailLoc} to location of {_a}
        draw 2 of end rod at {_trailLoc}
        draw 3 of electric spark at {_trailLoc}
        draw 1 of witch at {_trailLoc}
        draw 1 of soul fire flame at {_trailLoc} ~ vector(cos({_trailAngle}) * 0.2, sin({_trailAngle} * 2) * 0.15, sin({_trailAngle}) * 0.2)
        wait 1 tick
    if {_a} is valid:
        delete {_a}

on projectile hit:
    scoreboard tags of projectile contains "magic_arrow"
    set {_loc} to location of projectile
    delete projectile
    magicBlast({_loc})

function magicBlast(loc: location):
    set {_c} to {_loc} ~ vector(0, 1, 0)

    # Impact flash and expanding ground rings
    draw 50 of firework at {_c}
    draw 1 of explosion emitter at {_c}
    draw 20 of end rod at {_c}
    play sound "entity.generic.explode" with volume 1 with pitch 1.3 at {_c}
    play sound "block.beacon.activate" with volume 1 with pitch 2 at {_c}

    loop 8 times:
        set {_wave} to loop-number
        set {_radius} to {_wave} * 0.45
        loop 24 times:
            set {_ringAngle} to loop-number * 15
            set {_ringPos} to {_c} ~ vector(cos({_ringAngle}) * {_radius}, 0, sin({_ringAngle}) * {_radius})
            draw 1 of electric spark at {_ringPos}
            draw 1 of flame at {_ringPos}
        wait 1 tick

    # Summon the orbiting block displays
    set {_mats::*} to magma block, crying obsidian, amethyst block, glowstone, purple concrete, sea lantern, shroomlight, diamond block, emerald block, lapis block
    loop {@blocks} times:
        set {_i} to loop-number
        spawn a block display at {_c}
        set {_d::%{_i}%} to last spawned entity
        set display block data of {_d::%{_i}%} to random element of {_mats::*}
        set transformation scale of {_d::%{_i}%} to vector(0.4, 0.4, 0.4)
        set {_off::%{_i}%} to (360 / {@blocks}) * {_i}

    # Tightening, accelerating vortex
    set {_angle} to 0
    loop {@spin-ticks} times:
        set {_tick} to loop-number
        set {_p} to {_tick} / {@spin-ticks}
        set {_r} to 4 - (3.4 * {_p})
        set {_angle} to {_angle} + 6 + (50 * {_p} * {_p})
        loop {@blocks} times:
            set {_i} to loop-number
            set {_a} to {_angle} + {_off::%{_i}%}
            set {_y} to sin({_angle} * 0.7 + ({_i} * 40)) * 0.8
            set {_pos} to {_c} ~ vector(cos({_a}) * {_r}, {_y}, sin({_a}) * {_r})
            teleport {_d::%{_i}%} to {_pos} ~ vector(-0.2, -0.2, -0.2)
            draw 1 of end rod at {_pos}
            draw 1 of soul fire flame at {_pos}
            draw 1 of electric spark at {_pos}
        if mod({_tick}, 6) = 0:
            loop 24 times:
                set {_ringAngle} to loop-number * 15 + {_angle}
                set {_ringPos} to {_c} ~ vector(cos({_ringAngle}) * (1.5 - ({_p} * 0.5)), sin({_ringAngle} * 2) * 0.15, sin({_ringAngle}) * (1.5 - ({_p} * 0.5)))
                draw 1 of witch at {_ringPos}
            play sound "block.amethyst_block.chime" with volume 0.7 with pitch (0.5 + {_p} * 1.5) at {_c}
        wait 1 tick

    # Implosion pulse before the outward burst
    play sound "block.beacon.power_select" with volume 1 with pitch 0.7 at {_c}
    draw 30 of end rod at {_c}
    draw 20 of witch at {_c}
    loop {@blocks} times:
        set {_i} to loop-number
        set {_a} to {_angle} + {_off::%{_i}%}
        set {_pp::%{_i}%} to {_c} ~ vector(cos({_a}) * 0.35, 0, sin({_a}) * 0.35)
        teleport {_d::%{_i}%} to {_pp::%{_i}%} ~ vector(-0.2, -0.2, -0.2)

    # Burst the blocks out in random directions
    play sound "entity.firework_rocket.blast" with volume 1.5 with pitch 0.8 at {_c}
    play sound "entity.warden.sonic_boom" with volume 0.7 with pitch 1.6 at {_c}
    draw 60 of flame at {_c}
    draw 35 of electric spark at {_c}
    loop {@blocks} times:
        set {_i} to loop-number
        set {_yaw} to random number between 0 and 360
        set {_pitch} to random number between -50 and 80
        set {_spd} to random number between 0.5 and 1.4
        set {_v::%{_i}%} to vector(cos({_yaw}) * cos({_pitch}), sin({_pitch}), sin({_yaw}) * cos({_pitch})) * {_spd}

    loop {@burst-ticks} times:
        set {_tick} to loop-number
        loop {@blocks} times:
            set {_i} to loop-number
            subtract 0.03 from y component of {_v::%{_i}%}
            set {_pp::%{_i}%} to {_pp::%{_i}%} ~ {_v::%{_i}%}
            teleport {_d::%{_i}%} to {_pp::%{_i}%} ~ vector(-0.2, -0.2, -0.2)
            draw 1 of flame at {_pp::%{_i}%}
            draw 1 of smoke at {_pp::%{_i}%}
            draw 1 of electric spark at {_pp::%{_i}%}
        if mod({_tick}, 8) = 0:
            set {_radius} to 1 + ({_tick} * 0.12)
            loop 24 times:
                set {_ringAngle} to loop-number * 15
                set {_ringPos} to {_c} ~ vector(cos({_ringAngle}) * {_radius}, sin({_ringAngle} * 2) * 0.2, sin({_ringAngle}) * {_radius})
                draw 1 of end rod at {_ringPos}
        wait 1 tick

    # Final aftershock and cleanup
    play sound "block.respawn_anchor.deplete" with volume 0.8 with pitch 1.4 at {_c}
    loop {@blocks} times:
        set {_i} to loop-number
        draw 8 of poof at {_pp::%{_i}%}
        draw 4 of firework at {_pp::%{_i}%}
        delete {_d::%{_i}%}
    draw 24 of electric spark at {_c}