willard21 / minekhan Goto Github PK
View Code? Open in Web Editor NEWMinecraft for Khan Academy
Minecraft for Khan Academy
there are a few .SCH Worlds from
cubical.xyz than i think will be cool in MineKhan
Rename ME to file.schematic.txt
Add a device-recognition function, a couple of buttons, and a different set of mouse recognition features, and it should work on mobile. You can even do that on KhanAcad, no?
is MineKhan actually good for playing ???
NOT in a bad way JUST in a way of the game intriguing audience
Okay, I'm a bit of a perfectionist here, but when I press Ctrl-U to see the view source for controls (since I always forget) it still says this in the comments at the beginning of the code:
T: Reload textures
I know that T actually accesses chat, could you fix that? It's the most minor thing, so now I feel bad, but I posted this anyway :/
when would be a good time to start creating survival because as @Willard21 said currently if we implement it, it would be half-implemented when will MineKhan Be ready for survival beta?
Great stuff you got here! I'm absolutely amazed.
Just a quick question, why is all the code in the same file? Are there any intentions behind this decision?
any ideas on when and how we should implement a marketplace in minekhan where you can access hundreds of player made worlds and mods
How do I chat on willard.fun?
Here you can post step-by-step instructions on how to add new blocks to MineKhan or new items to MineKhan , how to work around the hundred of lines of code that MineKhan runs on.
Possible Questions:
1.How to add new blocks
2.How to mess round with the lighting / where.
3.How to style buttons in the code or which lines you should look around the edit.
And Plenty More!
When I leave or close a server and then open one of my worlds to the public, the players from the previous world appear in their last positions, and they don't seem to be linked to the actual players' clients. I can fix it by refreshing/reloading the page, so it probably isn't the most important issue here, but if you have time...
I think a lava block with no collisions similar to water (but with a opaque texture) would be useful in MineKhan. Also, I don't know why there isn't an icon for water, but assuming it's not too hard, could you add one (mostly so that less experienced players don't keep asking me how to get it)?
Whenever I press T and then Esc in the home menu, the chat opens and closes, and if I press esc a couple more times, I get the Paused menu minus a bunch of buttons. I need to restart the webpage to escape that menu. It also happens in the Worlds menu. I'm a terrible coder, but would something like
if (inWorld && World.multiplayer=true && KeyIsPressed && keyPressed=T) { //chat code here };
work?
I discovered this purely by accident, but it seems strange to me. I'm not sure if the chat messages sent in these menus can be seen by players in other worlds.
My friend multibuilder just asked me to request this :D
An ECO system in minekhan...
can you add either a button to lock a multiplayer world so no more people can get in or multiplayer wolds with passwords? people keep on coming into me and my friend's world and destroying everything.
Im on a school chromebook, and they blocked multiplayer :(
This would be for mods AND later versions of this program, would it be possible to make capabilities for multiple blocks in a one block space? for example, it would allow for water-logging, placing plants in plant pots, rather than making use of the block above the pot(mods have this, i made them actually...) and for things like fences... they would be much easier to make if i only had to make the post, and the crossbeam, because with that you can just place the beams around the post as needed to get any fence position, rather than having to make a model for every individual state(walls are even harder!)
Can you willburt add actually crafting and mining and survival mode
How do I ban annoying people that keep breaking things in my world?
Hi, me again (probably super annoying) but....... can you add more plants maybe??????? It probably takes a while so I'll be patient.
I accidentally banned myself by making a script that placed lots (thousands) of blocks, probably too fast, in my world. I set delays, but that didn't seem to work too well, so do you have any recommendations for how long I should make them? I used setTimeout with a 50 ms delay.
ok, I'm sure you're tired of people requesting things. Soooooo, I guess I'm here to humbly ask if you are working on anything in the game? Are you working on new blocks? Great game by the way!
Those of us who have added other blocks to this, we have probably come across that dreaded bug where if there are to many unique colors in an image, it gets corrupted. So, is it possible, that you could make an encoder that can handle all the colors? say an encoder that can handle 256 colors?(because that's how many pixels there are in the textures) that would be so nice for those of us wanting to add things like fire, nether portal blocks, sea lanterns, prismarine..... yeah, it wouldbe nice if you could do that.
As Shown on this Modded Ver of your game, it shows the biomes are possible, when i can, i will try to add it my self, but you know your programing better, you may be able to read his , and see how he did it
There are tons and tons of spin-offs that at https://khanacademy.org/computer-programming/minekhan/5647155001376768 that all don't have thumbnails and their titles are the same and they are made by the same person.
Made this issue so you would know this.
When will you add survival? I think it would be a great addition to the game!
The Default License for Khan Academy is MIT License. Can you add the MIT License to this program to make it easier to make forked copies of it? Thanks.
when i use super breaker i start to glitch to the blocks
So I had bad internet and I was on willard.fun,
I opened a world to public and joined on another device.
And then it said Connection lost so I opened it to public again.
Then I opened the developer tools to see what was going on and it sayed the host banned me.
It shouldn't be banning me because I was the host and I didn't ban anyone.
My server is stuck on the server list, even though it got disconnected. At the same time, I was still in the player list of another world, (I checked using /minekhan/worlds), even though I got disconnected from there. Maybe you could fix this by sending an activity check packet every now and then, and remove the server/player if the client doesn't respond?
I was checking the source, and it seems to be completely written in outdated practice.
Slapping a "use strict"
directive on causes all of the code to fail.
I could have contributed, but was this done for browser support, or were there any other reasons?
body {
overflow: hidden; /* Hide scrollbars */
}
.world-select {
width: 99vw;
min-width: 300px;
height: calc(100vh - 220px);
position: absolute;
bottom: 120px;
overflow-y: auto;
background-color: RGBA(0, 0, 0, 0.6);
justify-content: center;
margin: 0 auto;
}
.world {
width: 250px;
height: auto;
border: 1px solid black;
font-size: 18px;
font-family: monospace;
color: rgb(180, 180, 180);
margin: 0 auto;
margin-top: 15px;
padding: 5px;
cursor: pointer;
}
strong {
color: white;
}
.selected {
border: 3px solid white;
padding: 3px;
}
input[type=text] {
background-color: black;
caret-color: white;
border: 2px solid gray;
color: white;
font-size: 24px;
padding-left: 12px;
}
input[type=text]:focus {
border: 2px solid lightgray;
}
#boxcentertop {
font-family: Minecraftia;
z-index: 1;
width: 80vw;
max-width: 400px;
height: 50px;
position: relative;
top: 30px;
display: block;
margin: 0 auto;
}
.hidden {
display: none !important;
font-family: monospace;
}
#onhover {
background-color: rgba(0, 0, 0, 0.9);
color: rgb(200, 200, 200);
font-family: monospace;
word-wrap: normal;
width: auto;
max-width: 400px;
position: absolute;
z-index: 1;
padding: 10px;
cursor: default;
}
#quota {
font-family: Minecraftia;
display: block;
position: absolute;
width: 99vw;
margin: 0 auto;
bottom: 110px;
z-index: 1;
background-color: RGBA(0, 0, 0, 0.6);
justify-content: center;
text-align: center;
color: white;
}
#savebox{
font-family: monospace;
}
@keyframes success {
5% {
transform: translate(0px, -7px) rotateY(100deg);
}
30% {
transform: translate(0px, -24px) rotateY(-100deg);
}
55% {
transform: translate(0px, -67px) rotateY(100deg);
}
60% {
transform: rotateY(-100deg) scale(1.1, .9);
}
70% {
transform: rotate(5deg);
CODE ABOVE NEEDS TO BE FIXED FROM FOLLOWING PROJECT
https://www.khanacademy.org/computer-programming/geekypeoplecraft/4805420559319040
Can you make tools like in Minecraft pi edition? Oh and don't forget about opening doors.
i have a custom map and im kinda wanting to share
i thinking like a
Name
Link
pic
in the read me
https://www.khanacademy.org/computer-programming/minekhan-with-plants/6313230061223936
In this spin off the flowers and grass are actaully not solid blocks so they good :)
Servers Are Possible With CORS So Why Not Try It ๐
Note: I Am The One Who Said The Is 1000 X Better Than 2d benniums Version
The command /ban doesn't work on names that include spaces. Also, it might be a good idea to add longer-lasting bans and the ability to give world admin privileges to trusted players. Several times, I've been AFK when a griefer was on, and the legitimate players were unable to do anything about it.
I'm using a chromebook and the login and register buttons don't work.
I looked at the code and I think the "?" is causing it to not work.
Can you fix it?
Here is a very astonishing glitch I found in minekhan it's a spin-off
https://www.khanacademy.org/computer-programming/minecraft-but-broken/4914589619929088
You may notice that your x, y coordinates are VERY VERY high, meaning that we hundred of thousands of blocks away from spawn which makes the game TOO glitchy
If you are a Minecraft nerd then you might know about the far lands which are basically on the topic of how infinite can you make procedurally generated terrain if you do not know what far lands is here is a summary :
The Far Lands is a terrain bug that appears upon the overflowing of a noise generator, most notably the low and high noise overflow 12,550,821 blocks from the origin of the Minecraft world. There are other parts of Far Lands called Farther Lands and Corner Far Lands.
If not, you should open an issue describing what you'd like to change and why so that I can give feedback before you spend the time working on it. I don't like telling people to throw away their code, but I kinda have to when you open PRs unexpectedly.
Originally posted by @Willard21 in #9 (comment)
As requested, I'll create an issue before I do anything from now on.
There are several things that I would like to help remove/update that would significantly reduce the amount of code and simplify the code.
To start, there are plenty of unnecessary lookups across the code, which can be removed, or assigned to a local variable, ex:
Lines 606 to 612 in bc80c21
Which might be simpler written as:
data.textures = new Array(6).fill(data.texture);
} else if (data.textures.length === 3) {
data.textures[3] =
data.textures[4] =
data.textures[5] = data.textures[2];
} else if (data.textures.length === 2) {
Which is shorter and just as readable.
Lines 5225 to 5230 in bc80c21
Next, this is an array of object references, which are themselves arrays of f64s, and it requires an extra indirection to get a value out of the array, so, how about we change that?
const blocks = Int8Array.of(
7, 4, 1, 7,
7, 4, 2, 7,
7, 4, 3, 7,
7, 4, 4, 7,
...,
-8, -2, 8, 1
);
for (let i = 0; i < blocks.length; i += 4) {
block2( blocks[i + 0], blocks[i + 1], blocks[i + 2], blocks[i + 3] );
}
Just as readable, much shorter as all brackets would be omitted, and much more optimized, memory-wise and performance-wise.
Lines 191 to 199 in bc80c21
Lines 222 to 225 in bc80c21
Line 201 in bc80c21
(void)
parameter is reminiscent of 30-year old C style. (it can be omitted, the code will still compile fine)
There is heavy use of let
where const
would be more appropriate.
This code can use some updating:
Lines 281 to 283 in bc80c21
Lines 1444 to 1445 in bc80c21
These could've been:
const { Math } = self;
and
const { min, max } = Math;
respectively.
There's a good amount of code that lacks comments.
There are a large number of (unnecessary) copies done across the code, take this example:
Lines 1714 to 1720 in bc80c21
Code like this leaves me with plenty of questions: why was it an iife, instead of a simple block scope? Why did they use an array and push to it, instead of just make indexOrder
const
and fill it? Unless I'm mistaken, it could've been directly assigned new Uint32Array(100000 * 6)
and worked out from there.
This code heavily deals with arrays, yet I'm seeing plenty of places where normal arrays are used where TypedArrays would fit better.
There were some points in the middle of the code and near the end, that could use more modern constructs, ex: ES6 Maps instead of object literals. (ex: worlds
, blockIds
, Key
)
There are also plenty of miscellaneous things that I would recommend changing, or removing, especially mutating the window object.
Sometimes, I can't access multiplayer features; when I try to join or host a server, I get the "Connection lost!" error instantly. However, I see working servers, so others don't have this problem. If needed, I can post a few system specifications.
In my opinion server should be fixed since after the host logs out of the server the server just shuts down willard should create a seperate site where all the server are linked and you can join one
Any ideas for how we could implement sound effects into minekhan using while true or something ???
Possible First Ideas
1.A sound gets played when you click buttons.
2.Grass sound effects.
3.Block placing sound effect.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.