Would you use a Javascript API for Bukkit?

Discussion in 'Bukkit Discussion' started by AlbireoX, Apr 20, 2014.

?

Would you use this?

  1. Yes

    5 vote(s)
    71.4%
  2. No

    2 vote(s)
    28.6%
Thread Status:
Not open for further replies.
  1. Offline

    AlbireoX

    I'm planning on creating one of these, though I don't want to be making it only for myself. Code will look something like this (I will attempt to natively support Coffeescript):

    Code:
    on "PlayerJoin", (e) -> e.player.sendMessage("Welcome to the server!")
    
    Performance should be pretty close to native Java (especially when using Java 8). I want to know if people are interested in the development of such an API. I'm aiming to make something like Skript, but a lot more flexible. I will actively work to make it nearly as easy as Skript. I want to use it for educational purposes in the future. Thanks for reading.
     
  2. Offline

    Mike1022

    Isn't JavaScript for website development?
     
  3. Offline

    Hoolean

    Mike1022

    Not at all! Whilst it started out with client side web development for the browser, it has grown into something more, with server side JavaScript through Node.js becoming more and more popular for server side development and JavaScript being used to add scripting capabilities to applications that would otherwise not have it.

    AlbireoX

    I'd be pretty interested, depending on how it turns out. :)
     
  4. Offline

    Onlineids

    If someone would do this with python, I would be set.
     
  5. Offline

    deltahat

    I would not use javascript for plugin development. Bukkit relies heavily on the structure imposed by the java type system and makes heavy use of class hierarchies to model the entities and components of the Minecraft world. Javascript's dynamic typing and lack of a proper object oriented programming model make it ill suited for programming a game server. Lua and python are possibilities, but not javascript (in my opinion). I still think java is the best language for developing plugins because its the native language of Minecraft and you can go as deep as you need to into the Bukkit, Craftbukkit, or NetMinecraftServer code.
     
  6. Offline

    AlbireoX

    You can do all of this with Javascript as well with the Nashorn API. Java is of course still the best language for making full features plugins; this would just provide scripting for quick things.
     
  7. Offline

    mkremins

    Just FYI, there already exists a fairly mature project called ScriptCraft that attempts to do just this, providing JavaScript APIs for many common server management tasks and permitting on-the-fly execution of arbitrary JavaScript code via server command. Even if you decide to go ahead with writing your own API, you can probably learn a lot from looking at how ScriptCraft is implemented.

    Native CoffeeScript support would be interesting to have in such a project, and might go a long way towards making on-the-fly code evaluation even more user-friendly.
     
    AlbireoX and Hoolean like this.
  8. Offline

    MysteryManX

    That's exactly what I thought it was for.
     
  9. Offline

    AlbireoX

    mkremins
    Thanks for the link; I didn't know a project like this existed. However, I want to add some things that that plugin doesn't have. (Maybe I'll send a PR?)
     
Thread Status:
Not open for further replies.

Share This Page