Minecraft Chunk Generator

Size
5,306 Kb
Views
12,144

How do I make an minecraft chunk generator?

What is a minecraft chunk generator? How do you make a minecraft chunk generator? This script and codes were developed by Truman Heberle on 30 September 2022, Friday.

Minecraft Chunk Generator Previews

Minecraft Chunk Generator - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Minecraft Chunk Generator</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="origin" style="top: 40vh; left: 48vw; z-index: 0" class="cube"> <div class="face top"></div> <div class="face left shadeL"></div> <div class="face right shadeR"></div>
</div> <script src='https://code.jquery.com/jquery-2.2.4.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Minecraft Chunk Generator - Script Codes CSS Codes

body { min-height: 100vh; background: linear-gradient(to bottom, #cee7d4 0%, #f5f4c9 100%); background-repeat: no-repeat; background-attachment: fixed; overflow-y: scroll;
}
.cube { position: absolute;
}
.face { width: 30px; height: 30px;
}
.fade .top { opacity: 0.5; filter: alpha(opacity=50);
}
.fade .left { opacity: 0.5; filter: alpha(opacity=50);
}
.fade .right { opacity: 0.5; filter: alpha(opacity=50);
}
.hide .top { opacity: 0; filter: alpha(opacity=0);
}
.hide .left { opacity: 0; filter: alpha(opacity=0);
}
.hide .right { opacity: 0; filter: alpha(opacity=0);
}
.top { transform: rotate(210deg) skew(-30deg) scaleY(0.864) translate(0, 0);
}
.left { transform: rotate(30deg) skew(30deg) scaleY(0.864) translate(-15px, 0);
}
.shadeL { -webkit-filter: brightness(75%); filter: brightness(75%);
}
.right { transform: rotate(-30deg) skew(-30deg) scaleY(0.864) translate(15px, -30px);
}
.shadeR { -webkit-filter: brightness(125%); filter: brightness(125%);
}
.grass .top { background: url("https://t7.rbxcdn.com/48be183b4e905bb92e1fdd14161f32b9"); background-size: 100% 100%;
}
.grass .left { background: url(https://t4.rbxcdn.com/8fd032b78fe5c1dcc3dd50b1c3aad34c); background-size: 100% 100%;
}
.grass .right { background: url(https://t4.rbxcdn.com/8fd032b78fe5c1dcc3dd50b1c3aad34c); background-size: 100% 100%;
}
.stone .top { background: url(http://ih0.redbubble.net/image.33213025.7469/flat,800x800,070,f.jpg); background-size: 100% 100%;
}
.stone .left { background: url(http://ih0.redbubble.net/image.33213025.7469/flat,800x800,070,f.jpg); background-size: 100% 100%;
}
.stone .right { background: url(http://ih0.redbubble.net/image.33213025.7469/flat,800x800,070,f.jpg); background-size: 100% 100%;
}
.dirt .top { background: url(http://static.planetminecraft.com/files/resource_media/screenshot/1236/pack_3530346.jpg); background-size: 100% 100%;
}
.dirt .left { background: url(http://static.planetminecraft.com/files/resource_media/screenshot/1236/pack_3530346.jpg); background-size: 100% 100%;
}
.dirt .right { background: url(http://static.planetminecraft.com/files/resource_media/screenshot/1236/pack_3530346.jpg); background-size: 100% 100%;
}
.leaf .top { background: url(https://s-media-cache-ak0.pinimg.com/736x/e0/49/ec/e049ec4fac1dd42603bca9d5664707a6.jpg); background-size: 100% 100%;
}
.leaf .left { background: url(https://s-media-cache-ak0.pinimg.com/736x/e0/49/ec/e049ec4fac1dd42603bca9d5664707a6.jpg); background-size: 100% 100%;
}
.leaf .right { background: url(https://s-media-cache-ak0.pinimg.com/736x/e0/49/ec/e049ec4fac1dd42603bca9d5664707a6.jpg); background-size: 100% 100%;
}
.oak .top { background: url(http://orig06.deviantart.net/f273/f/2016/137/4/7/tokyo_travel_posters_by_mkatberry-da2tr8n.jpg); background-size: 100% 100%;
}
.oak .left { background: url(https://2.bp.blogspot.com/-WaUWXVriC8o/UGc7FG4dF5I/AAAAAAAAACg/ZHmiZwWh4S8/s1600/OakWoodMinecraft.jpg); background-size: 100% 100%;
}
.oak .right { background: url(https://2.bp.blogspot.com/-WaUWXVriC8o/UGc7FG4dF5I/AAAAAAAAACg/ZHmiZwWh4S8/s1600/OakWoodMinecraft.jpg); background-size: 100% 100%;
}
.coal .top { background: url(https://4.bp.blogspot.com/-v31oaKHu9Zk/T6AuLUADnaI/AAAAAAAABOM/KAMT4rDeOhs/s1600/minecraft_coal.jpg); background-size: 100% 100%;
}
.coal .left { background: url(https://4.bp.blogspot.com/-v31oaKHu9Zk/T6AuLUADnaI/AAAAAAAABOM/KAMT4rDeOhs/s1600/minecraft_coal.jpg); background-size: 100% 100%;
}
.coal .right { background: url(https://4.bp.blogspot.com/-v31oaKHu9Zk/T6AuLUADnaI/AAAAAAAABOM/KAMT4rDeOhs/s1600/minecraft_coal.jpg); background-size: 100% 100%;
}
.iron .top { background: url(http://media-mcw.cursecdn.com/thumb/b/b7/Iron_oreTex.png/120px-Iron_oreTex.png); background-size: 100% 100%;
}
.iron .left { background: url(http://media-mcw.cursecdn.com/thumb/b/b7/Iron_oreTex.png/120px-Iron_oreTex.png); background-size: 100% 100%;
}
.iron .right { background: url(http://media-mcw.cursecdn.com/thumb/b/b7/Iron_oreTex.png/120px-Iron_oreTex.png); background-size: 100% 100%;
}
.gold .top { background: url(http://media-mcw.cursecdn.com/thumb/3/32/Gold_oreTex.png/120px-Gold_oreTex.png); background-size: 100% 100%;
}
.gold .left { background: url(http://media-mcw.cursecdn.com/thumb/3/32/Gold_oreTex.png/120px-Gold_oreTex.png); background-size: 100% 100%;
}
.gold .right { background: url(http://media-mcw.cursecdn.com/thumb/3/32/Gold_oreTex.png/120px-Gold_oreTex.png); background-size: 100% 100%;
}
.diamond .top { background: url(https://s-media-cache-ak0.pinimg.com/564x/aa/61/74/aa61746fb69319ebe879abf44865daf6.jpg); background-size: 100% 100%;
}
.diamond .left { background: url(https://s-media-cache-ak0.pinimg.com/564x/aa/61/74/aa61746fb69319ebe879abf44865daf6.jpg); background-size: 100% 100%;
}
.diamond .right { background: url(https://s-media-cache-ak0.pinimg.com/564x/aa/61/74/aa61746fb69319ebe879abf44865daf6.jpg); background-size: 100% 100%;
}

Minecraft Chunk Generator - Script Codes JS Codes

crossorigin = "anonymous";
var faceStyle = getComputedStyle(document.querySelector('.face'));
var side = parseInt(faceStyle.width);
var dLeft = side * Math.pow(3, 1 / 2) / 2;
var dTop = side / 2;
var player = { x: 0, y: 0, z: 1
};
var worldLim = 5;
var blockRange = worldLim+2;
function assign(elemTrans, x, y, z, elemRel) { if (elemRel == null) { elemRel = document.getElementById("origin"); } dx = parseInt(elemRel.style.left) * window.innerWidth / 100; dy = parseInt(elemRel.style.top) * window.innerHeight / 100; zdex = parseInt(elemRel.style.zIndex); dx += -Math.floor(x) * dLeft + Math.floor(y) * dLeft; dy += Math.floor(x) * dTop - Math.floor(z) * side + Math.floor(y) * dTop; zdex += Math.floor(x) + Math.floor(y) + 10 * Math.floor(z); elemTrans.style.left = dx + "px"; elemTrans.style.top = dy + "px"; elemTrans.style.zIndex = zdex;
}
function addCube(x, y, z, material) { var id = x + "-" + y + "-" + z; if (material == null) { material = "grass"; console.log("Warning: Material Not Specified for Block " + id) } if (document.getElementById(id) == null) { $('body').append("<div id='" + id + "'></div>"); var cube = $("#" + id); cube.attr('style', 'top: 0px; left: 0px; z-index: 0'); cube.addClass(material); cube.addClass("cube"); cube.append("<div class='face top'></div>"); cube.append("<div class='face left shadeL'></div>"); cube.append("<div class='face right shadeR'></div>"); var cubeElement = document.getElementById(id); assign(cubeElement, x, y, z); getOpacity(x, y, z); }else{console.log("Warning: Block "+id+"already exists");}
}
function removeCube(x, y, z) { var id = x + "-" + y + "-" + z; $("#" + id).remove();
}
function getOpacity(x, y, z) { var id = x + "-" + y + "-" + z; var elem = $("#" + id); var distX = Math.abs(player.x - x); var distY = Math.abs(player.y - y); if (distX < blockRange && distY < blockRange) { elem.removeClass("fade"); elem.removeClass("hide"); } else { elem.addClass("hide"); elem.removeClass("fade"); }
}
function generateTree(x,y,z,height){ if(height == null){ height = 4+Math.floor(Math.random()); } for(var num=z+1;num<z+height+1;num++){ addCube(x,y,num,'oak'); } for(var leafX=-1;leafX<2;leafX++){ for(var leafY=-1;leafY<2;leafY++){ addCube(x+leafX,y+leafY,z-1+height,'leaf'); addCube(x+leafX,y+leafY,z+height,'leaf'); } } for(var leaf=-1;leaf<2;leaf++){ addCube(x+leaf,y,z+1+height,'leaf'); addCube(x,y+leaf,z+1+height,'leaf'); }
}
var z = new Object();
var dzdx = new Object();
var dxDir = Math.sign(.5-Math.random());
var dzdy = new Object();
var dyDir = Math.sign(.5-Math.random());
z[-worldLim+","+-worldLim] = Math.floor(Math.random()*-5);
dzdx[-worldLim+','+-worldLim] = Math.random()*dxDir/2;
dzdy[-worldLim+','+-worldLim] = Math.random()*dyDir/2;
addCube(-worldLim,-worldLim,z[-worldLim+','+-worldLim],"grass");
for(var a=-worldLim+1;a<worldLim;a++){ z[a+','+-worldLim] = z[a-1+','+-worldLim]+dzdx[a-1+','+-worldLim]; if(Math.abs(dzdx[a-1+','+-worldLim])>.5){ dxDir = dxDir*-1; } dzdx[a+','+-worldLim] = dzdx[a-1+','+-worldLim]+dxDir*Math.random()/5; dzdy[a+','+-worldLim] = (.75+Math.random()/2)*dzdy[a-1+','+-worldLim]; addCube(a,-worldLim,Math.floor(z[a+','+-worldLim]),'grass');
}
for(var a=-worldLim+1;a<worldLim;a++){ prev = a-1; z[-worldLim+','+a] = z[-worldLim+','+prev]+dzdy[-worldLim+','+prev]; if(Math.abs(dzdy[-worldLim+','+prev])>.5){ dyDir = dyDir*-1; } dzdy[-worldLim+','+a] = dzdy[-worldLim+','+prev]+dyDir*Math.random()/5; dzdx[-worldLim+','+a] = (.75+Math.random()/2)*dzdx[-worldLim+','+prev]; addCube(-worldLim,a,Math.floor(z[-worldLim+','+a]),'grass');
}
for(var a=-worldLim+1;a<worldLim;a++){ var aPrev = a-1; for(var b = -worldLim+1;b<worldLim;b++){ var bPrev = b-1; zxEst = z[aPrev+','+b]+dzdx[aPrev+','+b]; zyEst = z[a+','+bPrev]+dzdy[a+','+bPrev]; z[a+','+b] = (zxEst+zyEst)/2; dzdx[a+','+b] = (.5+Math.random())*(dzdx[a+','+bPrev]+dzdx[aPrev+','+b])/2; dzdy[a+','+b] = (.5+Math.random())*(dzdy[a+','+bPrev]+dzdy[aPrev+','+b])/2; addCube(a,b,Math.floor(z[a+','+b]),"grass"); }
}
for(var a=-worldLim;a<worldLim;a++){ for(var b=-worldLim;b<worldLim;b++){ zCur = Math.floor(z[a+','+b]); for(var dirt=1;dirt<3;dirt++){ addCube(a,b,zCur-dirt,'dirt') } for(var stone=-2*worldLim;stone<zCur-2;stone++){ if(Math.random()<.1){ addCube(a,b,stone,'coal'); } else if(Math.random()<.05){ addCube(a,b,stone,"iron"); } else if(Math.random()<.05 && stone<-worldLim){ addCube(a,b,stone,"gold"); } else if(Math.random()<.03 && stone<-1.25*worldLim){ addCube(a,b,stone,"diamond"); } else{ addCube(a,b,stone,'stone'); } } }
}
for(var trees=0;trees<4;trees++){ x = Math.floor(-worldLim+2*worldLim*Math.random()); y = Math.floor(-worldLim+2*worldLim*Math.random()); zCur = Math.floor(z[x+','+y]); generateTree(x,y,zCur);
}
Minecraft Chunk Generator - Script Codes
Minecraft Chunk Generator - Script Codes
Home Page Home
Developer Truman Heberle
Username trumanheberle
Uploaded September 30, 2022
Rating 4.5
Size 5,306 Kb
Views 12,144
Do you need developer help for Minecraft Chunk Generator?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Truman Heberle (trumanheberle) Script Codes
Create amazing art & images with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!