About MineKhan
If you want to suggest stuff, you should go to the website that this is on: hereWhere MineKhan came from
One upon a time, there was a game on Khan Academy called Scuscraft.One day, Willard spin-offed Scusraft and made MineKhan.
After many days, he ported it from a pjs program to to a webpage.
Then, when Willard made his own website (willard.fun), thingMaker copied the code and programmed it more so soon it became this.
The End.
Changelog
URL parameters
target=id - Join a server when loading is finished Example: https://thingmaker.us.eu.org/minekhan/?target=ew2nm43qjxz66hb4kwe5 nosound Example: https://thingmaker.us.eu.org/minekhan/?nosound
Controls
You can press Ctrl+H to hide the page and Ctrl+J to show it again.These controls are used only when playing in a world. You can change them by going to options and clicking change controls
With keyboard and mouse: * Right-click (or ctrl + left-click): place block * Left-click: Remove block * Middle-click: Pick block * In survival mode, hold down left-click or repeatedly left-click: Break block * Q: Sprint * Shift: Sneak and stop sitting * W: Walk forward * S: Walk backward * A: Walk left * D: Walk right * E: Open inventory * B: Toggle super Breaker * Z: Zoom * L: Toggle Spectator mode * Enter: Toggle slab/stair mode * Arrow Keys: look around * P or Esc: pause/unpause * 1-9 navigate hotbar * Spacebar: jump * Double jump: toggle flight * Shift (flying): fly down * Space (flying): fly up * T: Open chat * ; (semicolon): Release the pointer without pausing (for screenshots) * Backspace or delete: drops the item you're holding right now * /: Type command * H: Hyper builder * O: Toggle third person mode * U: Toggle sitting * F3: Show some info With keyboard and touchpad: * Click-with-two-fingers (or ctrl + click-with-one-finger): place block * Click-with-one-finger: Remove block * Click-with-three-fingers: Pick block * In survival mode, hold down one finger or repeatedly click-with-one-finger: Break block * Other controls are same as controls for keyboard and mouse With touch screen: * Tap: Place block / Attack * Press and hold: Break block / Use * Swipe: Look around (can be changed with mouse sensitivity) * Tap hotbar: Select slot * Press and hold hotbar: Drop item in slot * Buttons with arrows / joystick: Move around * There are also other controls that are self explanatory
Can't remember WASD keys?
Think of them as this:
| W: ⇧ | ||
| A: ⇦ | S: ⇩ | D: ⇨ |
Health
Health is a feature only in survival.A heart looks like this:
A half heart looks like this:
When you create a new world, you start with 20health.
When you have 0health, you die.
Losing health
There are many ways to lose health inluding fall damage, being attacked by other players, and touching cactus and lava.Effects
There are effects that change how the hearts look.When you are withered, it looks like this:

When you are freezing, it looks like this:
Inventory
When playing a world, press e to open the inventory.Creative inventory

Survival inventory

More info will
Crafting
You can access the crafting grid from the inventory or by right clicking a crafting table.The inventory crafting grid is 2×2.
The crafting table's crafting grid is 3×3.
Some things require a crafting table to be crafted.
Recipes
Click the collapsible to see crafting recipesFixed: You have to put the items in the grid the exact way.
Shaped: The ingredients have a certain shape and the shape can be moved around.
Shapeless: The ingredients can be arranged on the grid in any way
Resource packs
Resource packs for MineKhan are JSON files.The textures are encoded with this.
Example
Mods
You can write a mod when editing a world. They are JavaScript code that runs when you open a world.
How: go to Singleplayer, select the world, click Edit, click Edit mod, and write in the big textbox.
You might get errors if your code has syntax errors or does something wrong. Most errors can be hidden. You can always try again.
There are so many possibilities! Here are some examples:
// This shows a welcome message when someone joins. Try changing the message and color!
world.on("join", e => {
e.player.connection.send({type:"title", data:"Welcome "+e.player.username, color:"yellow"})
})
// You can show a message in the chat. The § symbols are for color codes.
world.on("join", e => {
e.player.connection.send({type:"message", data:"§aWelcome "+e.player.username, fromServer:true})
e.player.connection.send({type:"message", data:"§bThis world is "+world.name, fromServer:true})
})
// This makes you get damage when you click a redStain.
world.on("click", e => {
if(e.block === blockIds.redStain) e.player.damage(3, e.player.username+" died from clicking it.")
})
// This makes emerald blocks become checkpoints. When you stand on one, the respawn point is set there.
world.on("tick", e => {
for(let p of world.players){
if(p.world.getBlock(round(p.x), round(p.y-1), round(p.z)) === blockIds.emeraldBlock){
p.spawnPoint = {x:p.x, y:p.y, z:p.z}
}
}
})
// This stops fall damage.
world.on("damage", e => {
if(e.type === "fallbig" || e.type === "fallsmall"){
return "stop"
}
})
// This prevents people from breaking things.
world.on("changeblock", e => {
// Protect blocks between (-64, -64) and (63, 63)
if(e.x > -64 && e.z > -64 && e.x < 63 && e.z < 63){
return "stop"
}
// You can also protect a specific block.
if(e.prevBlock === blockIds.grass){
return "stop"
}
// You can even protect a categories of blocks
if(blockData[e.prevBlock].category === "nature"){
return "stop"
}
// Or hardness
if(blockData[e.prevBlock].hardness > 0.5){
return "stop"
}
})
// This gives someone items when they join if they don't already have it.
world.on("join", e => {
// This gives apples
if(!e.player.hasItem(blockIds.apple)){
e.player.newInvItem(blockIds.apple)
}
// You can also do this. The properties can be: id, amount, durability, customName, trim
if(!e.player.hasItem(blockIds.cake)){
e.player.newInvItem({id: blockIds.cake, customName: "Strange Cake"})
}
})
// Here is an example of world (terrain) generation.
// world[""] means overworld. can also be world["nether"] or world["end"]
world[""].customChunkGenerate = function(chunk){
for (let i = 0; i < 16; i++) { // for each column in the chunk
for (let k = 0; k < 16; k++) {
let wx = chunk.x + i
let wz = chunk.z + k
// Try adding another noise! Just copy this line and rename "noise" and add the new noise to the equation.
let noise = world.noiseProfile.noise(wx*0.1,wz*0.1)
let height = round(noise * 30 + 10) // multiply by 30 then add 10 then round it
for(let y=0; y<height; y++){ // from y=0 to y=height
chunk.setBlock(i,y,k,blockIds.dirt) // fill with dirt
}
chunk.setBlock(i,height,k,blockIds.grass) // put grass on top
chunk.biomes[k*16+i] = biomeIds.oldPineTaiga
chunk.tops[k*16+i] = height
}
}
chunk.waterTops = new Uint8Array(256)
}
world[""].customChunkPopulate = function(chunk){
for (let i = 0; i < 16; i++) {
for (let k = 0; k < 16; k++) {
wx = chunk.x + i
wz = chunk.z + k
ground = chunk.tops[k * 16 + i]
if(i === 3 && k === 9){
chunk.spawnSmallTree(i,ground,k,wx,wz, false) // Put a oak tree
}
}
}
}
// This spawns a house when you hold a brick and click. Note: block can also be an item.
// Define the list of blocks
const wallBlocks = [blockIds.quartzBlock, blockIds.bricks, blockIds.oakPlanks, blockIds.stoneBricks, blockIds.endStoneBricks, blockIds.purpurBlock, blockIds.deepslateTiles]
const frameBlocks = [blockIds.quartzPillar, blockIds.oakLog, blockIds.purpurPillar]
world.on("click", e => {
let wall = wallBlocks[floor(rand(wallBlocks.length))] // Choose a block
let frame = frameBlocks[floor(rand(frameBlocks.length))]
if(e.holding === blockIds.brick){
for(let x = -2; x <= 2; x++)
for(let y = -2; y <= 2; y++)
for(let z = -2; z <= 2; z++)
{
if((!x + !y + !z) === 2) continue // Stop for windows
let overlaps = (abs(x) === 2) + (abs(y) === 2) + (abs(z) === 2) // How many edges is this block in
if(overlaps >= 2){
world[""].setBlock(e.x+x, e.y+y+2, e.z+z, frame)
}else if(abs(x) === 2 || abs(y) === 2 || abs(z) === 2){
world[""].setBlock(e.x+x, e.y+y+2, e.z+z, wall)
}
}
e.holdObj.amount-- // Subtract one, it was used up
}
})
// You can set functions for certain blocks in blockData. There is onclick, serveronuse (on use), onupdate, onset, ondelete, onplace, onbreak, serverontouch (on touch), onpowerupdate (for redstone), ongetexploded, onburn, tick
// The functions in blockData will not change back, even if you exit the world, until you reload the page.
// This makes coal ore explode when clicked
blockData[blockIds.coalOre].onclick = function(x,y,z,world){
world.explode(x,y,z, 2) // The radius is 2
}
// This makes black stuff spread
blockData[blockIds.blackConcrete].tick = function(block,x,y,z,world){
x += round(rand(-1,1)) // Add a random amount between -1 and 1 to the coordinates
y += round(rand(-1,1))
z += round(rand(-1,1))
if(blockData[world.getBlock(x,y,z)].solid){ // If the block at those coordinates is solid
world.setBlock(x,y,z, blockIds.blackConcrete)
}
}
// This makes rose bush give blur effect
blockData[blockIds.roseBush].serverontouch = (x,y,z,ent) => ent.applyEffect("blur",1,2,false)
// When you touch poppy, become small. (reset with scale=1)
blockData[blockIds.poppy].serverontouch = (x,y,z,ent) => ent.scale = 0.75
// This makes logs break when not supported. (set the logs onupdate to cactus onupdate because cactus also breaks)
blockData[blockIds.oakLog].onupdate = blockData[blockIds.birchLog].onupdate = blockData[blockIds.jungleLog].onupdate = blockData[blockIds.cactus].onupdate
// This makes leaves fall (set the leaves onupdate to sand onupdate which falls)
blockData[blockIds.oakLeaves].onupdate = blockData[blockIds.birchLeaves].onupdate = blockData[blockIds.jungleLeaves].onupdate = blockData[blockIds.sand].onupdate
// You can even change some properties of blocks. Some properties are client-side, so changing them doesn't work.
// This makes tall grass drop carrots blockData[blockIds.TallGrass].drop = "carrot" blockData[blockIds.TallGrass].dropAmount = [0,2] // This makes diamond ore drop 75% dirt and 25% diamond blockData[blockIds.diamondOre].drop = () => rand()<0.75 ? "dirt" : "diamond" // This makes you get damaged when you touch redStain blockData[blockIds.redStain].damage = 5 // This changes the sound of stone blockData[blockIds.stone].digSound = ["click","cow.step1","pig.step1"] blockData[blockIds.stone].stepSound = ["click","cow.step1","pig.step1"]
// You can also change some properties and functions (methods) on entities.
// These will also not change back until you reload.
// This makes pigs hostile and attack.
entities[entityIds.Pig] = class WeirdPig extends entities[entityIds.Pig] {
constructor(x,y,z){
super(x,y,z)
this.hostile = true
this.minFollowDist = 1
this.maxFollowDist = 16
this.detectionDist = 16
this.attackStrength = 3
this.maxAttackCooldown = 20
}
// You can also change the drop
drop = [blockIds.mangroveLog]
dropAmount = [1,5]
experience = 5
}
// This makes entities heal when clicked
world.on("click", e => {
if(e.entity && e.player){ // Only runs when there is an entity and player
e.entity.health += 10
// This makes mobs go toward the player when clicked
if(e.entity.mob) e.entity.path = e.entity.findPath(e.player.x, e.player.y, e.player.z)
}
})
// To spawn mobs, use this code and change the coordinates:
world[""].addEntity(new entities[entityIds.Pig](10,50,10))
// Some entities take different arguments.
// It can also add item entities.
world[""].addItems(10,50,10, 0,0,0, blockIds.grass, true, 64) // The arguments are: x,y,z,vx,vy,vz,block,autoSetVel,amount,durability,customName,from
// This plays creepy sounds occasionly. Try changing it to different sounds!
// Note: rand() is the same as Math.random() except rand can have a range like this: rand(10) rand(1,10).
let lastTime = Date.now()
let sounds = ["damage.classic_hurt","block.portal.travel","grass.step3","creeper.say4"]
world.on("tick", () => {
let now = Date.now()
if(now - lastTime > 60000){ // Every 60 seconds. 1000 is 1 second.
let player = world.players[floor(rand(world.players.length))] // Choose a random player
// If these sounds are played at 0.1x speed or less, then it sounds kind of creepy
player.world.playSound(player.x,player.y,player.z, sounds[floor(rand(sounds.length))], Math.random()*10, Math.random()*0.1)
if(Math.random()>0.9){ // Also play this sound randomly.
player.world.playSound(player.x,player.y,player.z, "portal.portal", 50, Math.random()*0.2)
}
lastTime = now
}
})
// This makes the code run when someone goes in the coordinates.
// It might be easier to use command blocks.
// This gives someone an apple when they go between 10,50,10 and 20,60,20
world.addPortal(player => {
if(!player.hasItem(blockIds.apple)){
player.newInvItem(blockIds.apple)
}
}, 10,50,10, 20,60,20, "") // Put the 2 corner coordinates and dimension here. The coordinates are in this order: x,y,z,x,y,z.
// This teleports anyone that goes there
world.addPortal(player => {
player.tp(100, 50, 0)
}, 30,50,0, 40,60,10, "")
// This plays music when someone joins. It will be synced for everyone.
// You can also use the command like this: /playMusic "https://put url here"
world.on("join", e => {
if(!world.music.size){ // If no music is playing, play a new one
world.playMusic("https://raw.githubusercontent.com/InventivetalentDev/minecraft-assets/refs/heads/1.21.11/assets/minecraft/sounds/records/chirp.ogg")
}
})
// This occasionly plays random songs in a list:
let urls = [ // Example URLs for music
"https://raw.githubusercontent.com/InventivetalentDev/minecraft-assets/refs/heads/1.21.11/assets/minecraft/sounds/music/game/deeper.ogg",
"https://cdn.freesound.org/previews/831/831502_14312064-lq.mp3",
// Put more URLs here with quotes and a comma
]
let lastMusic = Date.now()
world.on("tick", () => {
let now = Date.now()
if(now - lastMusic > 10*60*1000){ // Every 10 minutes
let url = urls[floor(rand(urls.length))] // Choose a random song
world.playMusic(url)
lastMusic = now
}
})
// Although you can create custom dimensions, it is a little glitchy and won't save.
world["aether"] = new ServerWorldDimension(world, "aether")
world.on("touchportal", e => {
if(blockData[e.entity.world.getBlock(e.x,e.y,e.z)].name === "portal"){
e.entity.tp(8,50,8, e.entity.dimension ? "" : "aether")
return "stop"
}
})
// You can use custom terrain generation. See terrain example.