Trying to make minecraft like game with OpenSimplexNoise

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Tarun

Hi, I am trying make a game like Minecraft but have trouble making the terrain[ Hills , Mountains , etc ] and making the dirt blocks below the Grass Blocks

enter image description here

Here’s The Source Code

extends Spatial

enum Blocks {Dirt,Grass,Stone}
var ground_size = Vector3(10,10,10)
var next_chunk_coord = Vector3(0,0,0)
var noise
onready var map = $World/GridMap

func _ready():
randomize()
noise = OpenSimplexNoise.new()
noise.seed = randi()
noise.octaves = 3
noise.period = 18
noise.persistence = 0.8
chunk(ground_size.x,ground_size.y,ground_size.z)

func chunk(chunk_width,chunk_length,chunk_depth):
for x in chunk_width:
for y in chunk_depth:
for z in chunk_length:
var final = 0
var a = noise.get_noise_3d(x,y,z + next_chunk_coord.z)
#var a = noise.get_noise_1d(y)
if a < 0.02:
final = Blocks.Dirt
elif a >=0.02 and a < 0.4 :
final = Blocks.Grass
elif a >=0.4 and a < 0.7:
final = Blocks.Stone
else:
final = Blocks.empty()
for num in range(0,z):
map.set_cell_item(x,y,z + next_chunk_coord.z,final)
next_chunk_coord.z += chunk_length

I only used Gridmaps and a camera(for the preview)