;How to Make a Randomly Generating World

## Intro

Welcome to the tutorial on how to make a randomly generated, 2D world! Below will be a simplified way on how to make a 2D survival world. If you wish you may copy this style and tweak it to your liking on your world.

## Getting Started

To get started, first off, you will want to open commands and create a new trigger, WorldLoaded. Under that you will want to make a command block and make some commands and variables and commands are below:

You will also want to turn on the gravity in world settings, to help complete the illusion of this world.

### Commands needed for WorldLoaded

 generate
 /kill pickup
 /fill 0 0 127 127 water
 /variable set ground $random(30,40)
 /variable set generate 0
 A timer set to 128 seconds per 1 tick.

You may also add as much or as little as you need to this trigger. This is just the bare minimum needed for a randomly generated world.

Now that you have everything needed for starting the world, we are ready to move on to the next and final step if you are following this tutorial as is. If not, you may have more to add to it.

## Setting up the Generation Process

This part can be as simple or as complex as you wish. We are going to make this almost as simple as it can get, though we are going to add some things to make sure that the generation does not leave the boundaries of the world and give you empty areas of the map. You do not have to add this part if you wish.

We are going to be making this portion of the code in the Timer:tick trigger, but it can also be done in a few different ways. If you wish for a world that generates quickly, you may use triggers that don't make sense that still work. We are using the timer trigger since it is the easiest, most lag friendly, and has the least unexpected errors.

### Commands needed for Timer:tick

 /fill $subtract($ground,1) $generate $ground $generate grass\_floor
 /variable gain generate 1
 /variable gain ground $random(-1,1)
<=
**Else:** IfThenElse:
>=
$ground

30

/variable gain ground 1

$ground

40

/variable lose ground 1

Again, the last one is not needed, but if you want to, you may add it.

## Conclusion

After you have done all of these things. You will have a functioning, randomly generated world. Of course, this is a very, very simple version, but you may add as much or as little needed. This covers the basics of randomly generated worlds. All randomly generated have this much and oftentimes much more.

Below are some interesting things you could add and some interesting worlds made with different random generation.

### **Fun things to add to make generating seem less boring**

**A Loading Percentage**

A simple command you could do to make things more interesting is a percentage of how much is loaded. Here's a command.

/sidebar set 1 $round($multiply($divide($generate,128),100)) % loaded!

Comment more gimmicks you could add to make things more fun!

### Different maps that use random generation

1. JCraft (By:JPQ)
2. 2D Survival world (By Y\_E\_E\_T)
3. Dungeon raid (Made by Y\_E\_E\_T) Alpha
4. The backrooms (By Y\_E\_E\_T) V1.0

Thank you so much for reading this! Please check out some of my maps I've made

##### Different maps made by me:

𝐁𝐞𝐫𝐤𝐬𝐡𝐢𝐫𝐞 (By:JPQ)

Crystalline (By: JPQ)

JCraft(FAST GENERATION) (By:JPQ)v.1.6.0