Placing random blocks

Discussion in 'Plugin Development' started by Deckerz, Jun 5, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Deckerz

    How would i make it is you type /rnd 20%dirt 80%grass if replaces the floor around you with 20%dirt and 80%grass

    BTW: i only need the generation part as in the bit where it decides what to place
     
  2. Offline

    Rocoty

    I would: Calculate how many grass blocks and how many dirt blocks would fit into respective percentage with given amount of blocks. I would then store the blocks into a collection.

    After that I would iterate over every block in the selection and place a random block from the collection created earlier, deleting each block from the collection as they are selected.
     
  3. Offline

    Deckerz

    example please, i hate maths :p

    Rocoty bump :p

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
Thread Status:
Not open for further replies.

Share This Page