1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Custom Random block generator

Discussion in 'Skript' started by Rishaik, Nov 24, 2021 at 1:15 PM.

  1. Rishaik

    Rishaik Member

    Joined:
    Feb 9, 2021
    Messages:
    1
    Likes Received:
    0
    ( Sorry for bad eng )
    I'm currently working on a custom block generator.
    I want to code that generates a block when the block is broken.
    However, there is no way to recreate the block because we does not use the cobblestone generator.
    Instead of lava, I want to keep creating cobblestones at the point where water and fences meet.

    And my code is

    on break:
    event-block is fence
    loop blocks in radius 1 of event-block:
    y-coordinate of event-block is y-coordinate of loop-block
    loop-block is air:
    add location of loop-block to {_checks::*}
    wait 1 tick
    loop {_checks::*}:
    block at loop-value-1 is cobblestone
    chance of 30.25%:
    set block at loop-value-1 to coal ore
    wait 1 tick
    set loop-block to cobblestone
    chance of 30.0%:
    set block at loop-value-1 to iron ore
    wait 1 tick
    set loop-block to cobblestone
    chance of 0.35%:
    set block at loop-value-1 to emerald ore
    wait 1 tick
    set loop-block to cobblestone
    chance of 0.35%:
    set block at loop-value-1 to gold ore
    wait 1 tick
    set loop-block to cobblestone
    chance of 0.2%:
    set block at loop-value-1 to diamond ore
    wait 1 tick
    set loop-block to cobblestone
    chance of 0.4%:
    set block at loop-value-1 to lapis ore
    wait 1 tick
    set loop-block to cobblestone
    chance of 0.3%:
    set block at loop-value-1 to redstone ore
    wait 1 tick
    set loop-block to cobblestone
     
  2. Phuple

    Phuple Member

    Joined:
    Jun 25, 2021
    Messages:
    13
    Likes Received:
    1
    upload_2021-11-25_20-39-57.png
    Clicking on the plus icon, will bring this dropdown where you can select code and paste your code in there, it makes it easier to read for others,
    Due to this I cant rlly understand without the indentations, reply back to my message so I can further help you :emoji_slight_smile:
     
  3. KokoPlayzYT

    KokoPlayzYT Member

    Joined:
    Aug 6, 2021
    Messages:
    14
    Likes Received:
    0
    yeah i can't understand it as well, also if i really understood right then just use "set block" when the other block is broken.
     

Share This Page

Loading...