cosiqu

Create me a Skript for minecraft plugin called skript with these plugin addon skripts I have Skript,SKBEE and Skript-Particle Create me a command that is /asteroid And it makes a falling asteroids coming from one direction from the sky and a rotating magma block in the middle of fire particles and they crash into the ground and when they crash into the ground it gives random ores like diamonds and stuff that I can configure

And I can set how many asteroids hit like /asteroid hit 500 OR how long it goes for /asteroid start 120

will be 120 seconds

AND THE MAGMA CUBE IS A BLOCK DISPLAY

Kodari AI
KodariJul 29 at 1:03 pm 4
AsteroidStrike
A configurable Minecraft asteroid event built with Skript, SkBee, and Skript-Particle. Administrators start events by time or asteroid-hit count, while asteroids travel from one direction through the sky, contain a rotating magma block display surrounded by fire particles, and crash into the ground. Each impact drops configurable random ores with adjustable chances, quantities, speed, height, distance, radius, and spawn interval.

Place asteroid-strike.sk in plugins/Skript/scripts/, then run:

Plain Text
/sk reload asteroid-strike

Use /asteroid hit 500 or /asteroid start 120.

cosiqu

Make it have particles around it and its a magma block display tahts in the middle of the particles and it comes down and explodes on the ground dropping the diamonds or other ores

Kodari AI
KodariJul 29 at 1:09 pm 5

Updated asteroid-strike.sk so each asteroid now has:

  • A visible magma block display in the center

  • Rotating magma core

  • Surrounding flame, smoke, and lava particles

  • Particle radius and amount configurable at the top of the script

  • Explosion particles and explosion sound on impact

  • Configurable random ore drops: coal, iron, gold, redstone, emerald, and diamonds

  • Actual ore items drop instead of ore blocks

Configure these options:

Skript
particle-radius: 2
particle-count: 16

Reload it with:

Plain Text
/sk reload asteroid-strike

Then start an event:

Plain Text
/asteroid hit 500

or:

Plain Text
/asteroid start 120
cosiqu

Use magma_block as a display block with SKBEE and make it rotate with fire particles around it

Kodari AI
KodariJul 29 at 1:55 pm 3

Updated asteroid-strike.sk so the magma block display remains in the center while the fire particles orbit around it in a rotating circle.

The asteroid now has:

  • A SkBee block display

  • magma block as the display block

  • Rotating display orientation

  • Rotating flame particles around the magma block

  • Smoke and lava effects

  • Explosion and configurable ore drops on impact

Reload it with:

Plain Text
/sk reload asteroid-strike

Then start it with:

Plain Text
/asteroid hit 500

or:

Plain Text
/asteroid start 120
cosiqu

It still shows no block display

Kodari AI
KodariJul 29 at 2:05 pm 2

Fixed the display entity syntax:

Skript
spawn block_display at {_current}

The magma block display should now appear in the asteroid’s center with the surrounding fire particles.

Reload it:

Plain Text
/sk reload asteroid-strike

Then test:

Plain Text
/asteroid hit 1
Kodari can make mistakes. Review important code before using.
Files
asteroid-strike.sk
Code
1 260
asteroid-strike.sk
# AsteroidStrike
# Requires: Skript, SkBee, Skript-Particle
# Place this file in plugins/Skript/scripts/
# Reload with: /sk reload asteroid-strike

options:
    prefix: &8[&cAsteroidStrike&8]&r
    permission: asteroid.admin

    # Asteroid appearance and movement
    asteroid-block: magma block
    flight-height: 35
    flight-distance: 30
    asteroid-speed: 0.9
    asteroid-fall-speed: 0.65
    impact-radius: 8
    spawn-interval: 10 ticks
    particle-radius: 1.8
    particle-count: 24

    # Asteroid shape
    asteroid-piece-count: 4
    asteroid-piece-radius: 2

    # Loot quantity
    loot-minimum: 1
    loot-maximum: 3

    # Loot weights. Keep the total at 100 for predictable chances.
    coal-chance: 35
    iron-chance: 25
    gold-chance: 18
    redstone-chance: 12
    emerald-chance: 7
    diamond-chance: 3

    # Core display rotation
    rotation-step: 18

on script load:
    set {asteroid.running} to false
    set {asteroid.hits} to 0
    set {asteroid.spawned} to 0

command /asteroid [<text>] [<number>]:
    permission: {@permission}
    permission message: "{@prefix} &cYou do not have permission to use this command."
    trigger:
        if arg-1 is not set:
            send "{@prefix} &e/asteroid hit <amount> &7- Run until the specified number of asteroids hit the ground."
            send "{@prefix} &e/asteroid start <seconds> &7- Run the event for the specified duration."
            send "{@prefix} &e/asteroid stop &7- Stop the current event."
            send "{@prefix} &e/asteroid status &7- View the current event status."
            stop

        if arg-1 is "hit":
            if arg-2 is not set:
                send "{@prefix} &cUsage: /asteroid hit <amount>"
                stop

            if sender is not a player:
                send "{@prefix} &cThis command must be used by a player."
                stop

            if {asteroid.running} is true:
                send "{@prefix} &cAn asteroid event is already running."
                stop

            if arg-2 is less than 1:
                send "{@prefix} &cThe hit amount must be at least 1."
                stop

            set {asteroid.center} to location of player
            set {asteroid.mode} to "hits"
            set {asteroid.limit} to arg-2
            set {asteroid.duration} to 0
            set {asteroid.hits} to 0
            set {asteroid.spawned} to 0
            set {asteroid.started} to now
            set {asteroid.running} to true

            send "{@prefix} &aStarted an asteroid event for &e%arg-2% &aimpacts."
            runAsteroidEvent()
            stop

        if arg-1 is "start":
            if arg-2 is not set:
                send "{@prefix} &cUsage: /asteroid start <seconds>"
                stop

            if sender is not a player:
                send "{@prefix} &cThis command must be used by a player."
                stop

            if {asteroid.running} is true:
                send "{@prefix} &cAn asteroid event is already running."
                stop

            if arg-2 is less than 1:
                send "{@prefix} &cThe duration must be at least 1 second."
                stop

            set {asteroid.center} to location of player
            set {asteroid.mode} to "time"
            set {asteroid.limit} to 0
            set {asteroid.duration} to arg-2
            set {asteroid.hits} to 0
            set {asteroid.spawned} to 0
            set {asteroid.started} to now
            set {asteroid.running} to true

            send "{@prefix} &aStarted an asteroid event for &e%arg-2% &aseconds."
            runAsteroidEvent()
            stop

        if arg-1 is "stop":
            if {asteroid.running} is false:
                send "{@prefix} &eThere is no asteroid event running."
                stop

            set {asteroid.running} to false
            send "{@prefix} &cAsteroid event stopped. &7Impacts: &e%{asteroid.hits}%"
            stop

        if arg-1 is "status":
            if {asteroid.running} is false:
                send "{@prefix} &7No asteroid event is currently running."
                stop

            if {asteroid.mode} is "hits":
                send "{@prefix} &aEvent active. &7Impacts: &e%{asteroid.hits}%&7/&e%{asteroid.limit}%"
            else:
                send "{@prefix} &aEvent active. &7Impacts: &e%{asteroid.hits}% &7| Duration: &e%{asteroid.duration}% seconds"
            stop

        send "{@prefix} &cUnknown subcommand. Use &e/asteroid &cfor help."


function runAsteroidEvent():
    while {asteroid.running} is true:
        if {asteroid.mode} is "hits":
            if {asteroid.hits} is greater than or equal to {asteroid.limit}:
                set {asteroid.running} to false
                stop

        if {asteroid.mode} is "time":
            if difference between now and {asteroid.started} is greater than or equal to {asteroid.duration} seconds:
                set {asteroid.running} to false
                stop

        spawnAsteroid()
        wait {@spawn-interval}

    if {asteroid.mode} is "hits":
        broadcast "{@prefix} &aAsteroid event complete! &7Total impacts: &e%{asteroid.hits}%"
    else:
        broadcast "{@prefix} &aAsteroid event complete! &7Total impacts: &e%{asteroid.hits}%"


function spawnAsteroid():
    set {_impact} to {asteroid.center}

    # Randomize the impact point around the command location.
    add random integer between -{@impact-radius} and {@impact-radius} to x-coordinate of {_impact}
    add random integer between -{@impact-radius} and {@impact-radius} to z-coordinate of {_impact}

    # Asteroids approach from the positive X direction.
    set {_current} to {_impact}
    add {@flight-distance} to x-coordinate of {_current}
    add {@flight-height} to y-coordinate of {_current}

    set {_pieces::*} to nothing

    # Create the visible asteroid chunks as falling blocks.
    loop {@asteroid-piece-count} times:
        set {_piece-location} to {_current}
        add random integer between -{@asteroid-piece-radius} and {@asteroid-piece-radius} to x-coordinate of {_piece-location}
        add random integer between -{@asteroid-piece-radius} and {@asteroid-piece-radius} to y-coordinate of {_piece-location}
        add random integer between -{@asteroid-piece-radius} and {@asteroid-piece-radius} to z-coordinate of {_piece-location}

        spawn falling block at {_piece-location}
        set {_piece} to last spawned entity
        set block data of {_piece} to {@asteroid-block}
        set gravity of {_piece} to false
        add {_piece} to {_pieces::*}

    # Create the rotating magma block as a SkBee block display.
    spawn a block display at {_current}
    set {_core} to last spawned entity
    set display block of {_core} to magma block
    set display scale of {_core} to vector(1.5, 1.5, 1.5)

    set {_rotation} to 0

    while y-coordinate of {_current} is greater than y-coordinate of {_impact}:
        subtract {@asteroid-speed} from x-coordinate of {_current}
        subtract {@asteroid-fall-speed} from y-coordinate of {_current}

        loop {_pieces::*}:
            set {_piece-location} to location of loop-value