#Moonrock autogenerated world

1 messages · Page 1 of 1 (latest)

winged tide
#

im trying to make my skript work for my custom world generation world and i have no idea how to fix it. this is using SkBee, Skript, and Multiverse-Core,
I will send the script i am using in the next few messages in maybe 5-6 messages as it is pretty long

#
command /setupMoonWorld:
    trigger:
        # Create the world using Multiverse-Core with a flat world generator
        execute console command "mv create moonworld normal -t flat"
        wait 10 seconds # Wait to ensure the world is fully created
        
        # Reload Multiverse to ensure the new world is recognized
        execute console command "mv reload"
        send "&aWorld 'moonworld' created and Multiverse-Core reloaded."

        # Teleport the player to the new world
        if world("moonworld") is set:
            teleport player to location at 0, 100, 0 in world("moonworld")
            send "&aTeleporting to 'moonworld'."
        else:
            send "&cWorld 'moonworld' does not exist."

        # Define moon rock generation parameters
        set {_world} to world("moonworld")
        set {_rockCount} to 10 # Number of moon rocks to generate
        set {_minDistance} to 30
        set {_maxDistance} to 100

        # Generate moon rocks in the sky world
        loop {_rockCount} times:
            set {_x} to random integer between -1000 and 1000
            set {_y} to random integer between 64 and 100
            set {_z} to random integer between -1000 and 1000
            set {_size} to random integer between 5 and 15

            # Generate a spherical moon rock
            loop 0 to {_size} - 1:
                set {_i} to loop-number
                loop 0 to {_size} - 1:
                    set {_j} to loop-number
                    loop 0 to {_size} - 1:
                        set {_k} to loop-number
                        set {_dx} to {_i} - {_size} / 2
                        set {_dy} to {_j} - {_size} / 2
                        set {_dz} to {_k} - {_size} / 2
                        if {_dx} * {_dx} + {_dy} * {_dy} + {_dz} * {_dz} <= {_size} * {_size}:
                            set {_blockLocation} to location at {_x} + {_dx}, {_y```
#
                            if block at {_blockLocation} is air:
                                # Randomly assign block type
                                set {_randomChance} to random integer between 1 and 100
                                if {_randomChance} <= 7:
                                    set block at {_blockLocation} to iron ore
                                else if {_randomChance} <= 9:
                                    set block at {_blockLocation} to gold ore
                                else if {_randomChance} <= 10:
                                    set block at {_blockLocation} to diamond ore
                                else:
                                    set block at {_blockLocation} to stone
                                
            send "&aGenerated a moon rock at ({_x}, {_y}, {_z}) in 'moonworld'."```
#

the error i am receiving is this

Can't understand this loop: 
'0 to {_size} - 1'```