Slashdot Mirror


JavaScript Comes To Minecraft

mikejuk writes "JavaScript is the language of the client and it is becoming the language of the server. Now it seems set to be the language of Minecraft. ScriptCraft is a Minecraft mod that can be added to the game to allow the player to use JavaScript commands. Walter Higgins ported the Rhino JVM implementation of JavaScript in a few spare weeks over Xmas. Some additional JavaScript classes allow the construction of blocks making it possible to automate construction. It also provides a 'turtle like' drone class that makes it easier to move in 3D. It makes use of a fluent API to create a domain specific language for movement. As its creator says: 'Ultimately I think the ScriptCraft mod could be used to take building in Minecraft to a whole new level. With a full-blown language at the Player's disposal, it should be possible to create not just castles and forts but entire road networks and cities.' Most importantly of all, it not only pushes the boundary of Minecraft, it also provides a way to get kids who are already hooked on Minecraft to start learning JavaScript."

28 of 149 comments (clear)

  1. Re:Java IS NOT JavaScript, you morons! by The+MAZZTer · · Score: 4, Informative

    RTFS. Just because Java and JavaScript appear in the same paragraph doesn't mean someone is equating the two. This is a JavaScript engine coded in Java, hooked up to Minecraft.

  2. Nerd antennae went up by iluvcapra · · Score: 5, Funny

    I saw the headline and half expected that someone had in fact implemented a Javascript interpreter with MineCraft.

    --
    Don't blame me, I voted for Baltar.
    1. Re:Nerd antennae went up by Fallingcow · · Score: 4, Funny

      Javascript running via a 3D world written in Java would have a Lovecraftian madness-inducing quality. You'd take one look at it and start bleeding from the eyes while producing an inhuman scream, before vomiting up most of your internal organs.

      I mean, either of those things (Javascript, or a 3D world written in Java) are capable of getting you half way there all on their own. Both cannot exist, yet they do. Even thinking of the two being combined is enough to PH'NGLUI MGLW'NAFH CTHULHU R'LYEH WGAH'NAGL FHTAGN **carrier lost**

    2. Re:Nerd antennae went up by HaZardman27 · · Score: 2

      I think GP was saying he expected to see a Javascript implementation created within Minecraft using redstone circuits (there are folks who have created working CPUs using redstone circuits).

      --
      Apparently wizard is not a legitimate career path, so I chose programmer instead.
    3. Re:Nerd antennae went up by vlm · · Score: 4, Funny

      I'd much rather see a java implementation using lots and lots of redstone. Then you could theoretically run minecraft on minecraft in infinite regression. This could cause the end of the world so I'd be careful.

      --
      "Science flies us to the moon. Religion flies us into buildings." - Victor Stenger
    4. Re:Nerd antennae went up by HaZardman27 · · Score: 2

      Remind's me of The Onion's World of World of Warcraft.

      --
      Apparently wizard is not a legitimate career path, so I chose programmer instead.
    5. Re:Nerd antennae went up by Bigbutt · · Score: 4, Funny

      "How did he type **carrier lost**"

      "Perhaps he was dictating it."
      "Shut-up"

      [John]

      --
      Shit better not happen!
    6. Re:Nerd antennae went up by Fallingcow · · Score: 4, Insightful

      I didn't intend it that way but it kind of works, since Lovecraft did that kind of shit all the time.

      "The end is near. I hear a noise at the door, as of some immense slippery body lumbering against it. It shall not find me. God, that hand! The window! The window!"

      Maybe if he weren't taking the time to write "The window! The window!" his odds of escaping would improve.

  3. You can do this in Java already? by shaitand · · Score: 4, Interesting

    You can already do all this in Java. What is the benefit of exposing players to the wonder of javascript via minecraft vs exposing them to the wonders of java via minecraft? Either one is a POS.

    I wish someone would do a C rewrite. People make excuses about the fully manipulable world and such but the reality is that there is nothing going on in minecraft that would make it tax a Pentium 3 without no gpu offloading had it been authored well in a decent language.

    Don't get me wrong it's a great game and fun to play. The implementation just leaves a lot to be desired. Buggy as hell too but you can't blame that on the language!

    1. Re:You can do this in Java already? by timeOday · · Score: 4, Interesting
      I'm delighted that Minecraft is in Java because my son plays it all the time, it's more constructive than other games, and it also happens to be just about the ONLY game that will run on our computer, because it's Linux. (Well, flash web games work too, and Club Penguin had a healthy run at our place... but I doubt Flash is what you are advocating).

      OK, I realize there has been some variety of games over the years which were released for Linux like quake 3. But as for games on Linux that are actually currently popular, and which people playing on different OS can link up and talk to each other, there are extremely few.

    2. Re:You can do this in Java already? by CastrTroy · · Score: 2, Informative

      There's nothing inherently special about Java that makes it able to run games on Windows/Linux any more than C/C++. If the programmers set out to make a program that will run on both, it will run on both. If they just assume it will work on Linux, or have no intention of it running on Linux, then it doesn't matter if it's written in Java, C or .Net, it won't run on Linux.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    3. Re:You can do this in Java already? by Pieroxy · · Score: 5, Interesting

      There's nothing inherently special about Java that makes it able to run games on Windows/Linux any more than C/C++.

      Holy fucking Jesus Christ, you haven't learned much in all that time have you? There is a hell of a lot more in Java. I once saw a (server-side) project of about 100k classes go from Java 1.3 32bit on Windows to Java 1.4 64bit on Solaris without even needing a recompilation. The stuff just worked.

      This is miles and miles away from what it would have meant in C or C++, and you know it. Of course, C and/or C++ done properly can achieve something that is portable, but at least your most common data type doesn't change whenever you change the number of fucking bits in your CPU. Not mentioning the stability of the APIs whenever you want to do anything vaguely more complex than fopen.

    4. Re:You can do this in Java already? by mark-t · · Score: 2

      This.

      It's not that it's impossible to write nonportable java, it's just that what's interesting about Java, particularly when you compare it to C or C++, is that you get that portability with practically zero extra effort.

      Java is not unique in this regard... although to the best of my knowledge, most of the other languages that achieve the goal are script-based.

    5. Re:You can do this in Java already? by Zmobie · · Score: 4, Informative

      No, not in this case. You must not be very familiar with java and its runtime. Java is DESIGNED to be extremely portable and is in fact one of the biggest reasons it was able to rise up and compete with C++ originally. I have ported many programs in java from a Windows Eclipse environment to a Linux native compiler and both of them produce virtually the same files, the compiled files actually ran on both environments without a recompile pretty much every time that I remember.

      C++ on the other had can be a BEAST to try and port even trivial programs between Windows and Linux, and in my early college days proved to be a pain in the ass because we standardized all of our programs compilations to the gcc and g++ Linux compilers while I was used to doing a lot of my coding using either Borland or Visual Studios on a Windows machine (Visual Studios has its own weird flavors as it is, but even more generic compilers had nasty results).

    6. Re:You can do this in Java already? by cwebster · · Score: 2

      Get Play On Linux http://www.playonlinux.com/en/, (your distro might distribute it). It comes with user contributed install scripts for a variety of games (from CD/DVDs, GoG, Steam, etc), which will download the version of wine with the best compatibility / least regressions for a particular title, install needed runtimes, do all the winetricks magic needed and install the games. I've installed a few old GoG games and some newer ones. I'm playing Skyrim through PoL now and it runs (with DLC, high rest textures, and a handful of mods) just fine. Give it a shot, even if you dont have a GPU that will run the highest end games, you can get most of the classics through GoG and install/play them with PoL.

    7. Re:You can do this in Java already? by Dasuraga · · Score: 2

      I think you underestimate the quality of javascript (which is not the worst thing you could use as a scripting language, def better than using java of all things), and overestimate the role of Java in the "slowness" of the game. Just because the graphics look like they're from quake 2 doesn't mean that's all there is to it.

      take Dwarf Fotress and try to play it on a P3. You might think it's running normally because it's hard to gauge speed in a text-based interface but... it's running really slowly. World simulation is computation heavy(probably a lot of cache issues too), no matter what way you cut it. Fun anecdote: my first experiences with DF were on a Pentium 3, and I played it like that for maybe a month before trying it on a fast computer. Boy was I in for a ride.

  4. They have it backwards... by Zontar+The+Mindless · · Score: 2

    Most importantly of all, it not only pushes the boundary of Minecraft it also provides a way to get kids who are already hooked on Minecraft to start learning JavaScript

    No, most importantly for my kid, it has the potential to get a highly JS-capable dad interested in Minecraft (a diversion he has hitherto managed to avoid).

    However, whether this be a good thing or a bad one is a matter that's entirely up for debate. :)

    --
    Il n'y a pas de Planet B.
  5. Re:Java IS NOT JavaScript, you morons! by Zmobie · · Score: 2

    RTFS. Just because Java and JavaScript appear in the same paragraph doesn't mean someone is equating the two. This is a JavaScript engine coded in Java, hooked up to Minecraft.

    Couldn't have said it better myself. It boggles the mind how many don't realize languages can target different run time instances and that *gasp* compilers sometimes are just layered language implementations. One of my college professors wrote a prolog compiler entirely in Java that was a very good compiler actually. Hell if one were so inclined, they could write a C# application that targets a JVM instead of the .NET framework.

  6. Re:Why wont JS just go away by jones_supa · · Score: 2

    Why better than Python?

  7. xbox360 port by vlm · · Score: 2

    I would imagine this will primarily serve to ostracize the xbox port even further away from mainstream minecrafting.

    --
    "Science flies us to the moon. Religion flies us into buildings." - Victor Stenger
  8. Re:Why wont JS just go away by vlm · · Score: 3, Informative

    Does python still use whitespace as part of control flow structures? Ugh. I don't want to be the guy who posts the equivalent of "mysql doesn't have transactions" over and over in 2013, but I can't be bothered to keep up with a language I don't use, either.

    It is however a fact that Python at least USED TO BE in a really bad neighborhood, sandwiched in between COBOL and FORTRAN in the "compiler really cares a lot about whitespace" ghetto, even if they've fixed it since then. I'd rather write a million parenthesis in LISP.

    --
    "Science flies us to the moon. Religion flies us into buildings." - Victor Stenger
  9. I am amused by Windwraith · · Score: 5, Interesting

    I find it amusing that this is news but what about LuaForge? It allows you to do Minecraft stuff in Lua, a language that can't be easier to learn, and is also pretty fast out of the box.

  10. Re:Why wont JS just go away by larry+bagina · · Score: 4, Funny

    Haven't fixed it, won't fix it.

    >>> from __future__ import braces
    File "", line 1
    SyntaxError: not a chance

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

  11. Re:Java IS NOT JavaScript, you morons! by Anonymous Coward · · Score: 2, Informative

    "JavaScript is the language of the client and it is becoming the language of the server. Now it seems set to be the language of Minecraft."

    translated : "Javascript is a language that is often used in client side programs, and increasingly is used in server side applications. And soon it may also be usable within minecraft." Hell the second sentence makes it pretty clear that the first sentence isn't even talking about minecraft.

  12. Re:Why wont JS just go away by HaZardman27 · · Score: 2

    If that's the only thing you can find wrong with Python, then I think that speaks much more good about the language than bad. When I first started playing with Python, I got tripped up a few times about inconsistent use of tabs vs spaces, but I have vim configured to take care of that for me now. Even if I want something fast or low-level, I will typically compile a shared object file for some C code, and then wrap it up in Python with Python's ctypes API. This gives me a good trade-off of the performance and predictability of compiled C and the ease-of-use of Python for more trivial code.

    --
    Apparently wizard is not a legitimate career path, so I chose programmer instead.
  13. New Version of JavaScript Needed! by Jaxim · · Score: 2

    I feel sorry for the Minecraft developers. Have fun with a language that doesn't have a class object system like every other modern mature computer language which makes working in a team environment so much easier.

    While we're at it, why don't we introduce PERL to minecraft?

    HTML was upgraded to HTML5 and CSS was upgraded to CSS3. Why can't JavaScript be upgraded so it is more in line with modern languages? If that could happen then Google could give up on developing their new DART language which is designed to replace JavaScript.

  14. Hardly revolutionary by Mercano · · Score: 4, Informative

    Not sure how this is a groundbreaking achievement. ComputerCraft already provides a LUA interpreter and turtles, and has a lot more documentation. There's also RedPower's Control module, that gives you an emulated 6502-based 8 bit computer. A FORTH boot disk can be crafted in-game, or you can edit your save files to bring in either an BASIC boot disk or your own assembler code. (Previous /.coverage of the 6502 emulator blocks)

    --
    #include <signature.h>
  15. Re:WorldEdit did it first... by Nexus+Unplugged · · Score: 2

    That would be CraftScript, which yes, has been around for quite a while. It also uses Rhino.