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.

  1. Rishaik

    Rishaik Member

    Joined:
    Feb 9, 2021
    Messages:
    3
    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

    Code (Text):
    1. on break:
    2.     event-block is fence
    3.     loop blocks in radius 1 of event-block:
    4.         y-coordinate of event-block is y-coordinate of loop-block
    5.         loop-block is air:
    6.             add location of loop-block to {_checks::*}
    7.             wait 1 tick
    8.             loop {_checks::*}:  
    9.                 block at loop-value-1 is cobblestone
    10.                 chance of 30.25%:
    11.                     set block at loop-value-1 to coal ore
    12.                     wait 1 tick
    13.                     set loop-block to cobblestone
    14.                 chance of 30.0%:
    15.                     set block at loop-value-1 to iron ore
    16.                     wait 1 tick
    17.                     set loop-block to cobblestone
    18.                 chance of 0.35%:
    19.                     set block at loop-value-1 to emerald ore
    20.                     wait 1 tick
    21.                     set loop-block to cobblestone
    22.                 chance of 0.35%:
    23.                     set block at loop-value-1 to gold ore
    24.                     wait 1 tick
    25.                     set loop-block to cobblestone
    26.                 chance of 0.2%:
    27.                     set block at loop-value-1 to diamond ore
    28.                     wait 1 tick
    29.                     set loop-block to cobblestone
    30.                 chance of 0.4%:
    31.                     set block at loop-value-1 to lapis ore
    32.                     wait 1 tick
    33.                     set loop-block to cobblestone
    34.                 chance of 0.3%:
    35.                     set block at loop-value-1 to redstone ore
    36.                     wait 1 tick
    37.                     set loop-block to cobblestone
     
    #1 Rishaik, Nov 24, 2021
    Last edited: Dec 3, 2021
  2. Phuple

    Phuple Member

    Joined:
    Jun 25, 2021
    Messages:
    15
    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:
    20
    Likes Received:
    1
    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...