Problem with Ore Skript

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Zakkeagle

New Member
Oct 20, 2017
5
0
0
24
So, I'm working on a skript where ores only spawn in caves aka if they're in a 2 block radius of an air block. I seem to hit a bump in my process. When I load it in, it says there are no errors, but for some reason, most ores still get replaced, even if they are within the air radius.

Code:
code_language.skript:
on chunk generate:
    set {_ChunkCorner1} to location at block at 15, 256, 15 in event-chunk
    set {_ChunkCorner2} to location at block at 0, 0, 0 in event-chunk
    loop all blocks within {_ChunkCorner1} to {_ChunkCorner2}:
        if loop-block-1 is a diamond ore:
            loop all blocks in radius 2 of loop-block-1:
                loop-block-2 is not air:
                    set loop-block-1 to stone
        else if loop-block-1 is a gold ore:
            loop all blocks in radius 2 of loop-block-1:
                loop-block-2 is not air:
                    set loop-block-1 to stone
        else if loop-block-1 is a redstone ore:
            loop all blocks in radius 2 of loop-block-1:
                loop-block-2 is not air:
                    set loop-block-1 to stone
 
Status
Not open for further replies.