1. Welcome to LilyPad. Download the project, explore the forums, and create your own LilyPad network.


    If you use the software and enjoy it or have a question, or would like to contribute to the future of the software directly or through resources, please sign up and join our little community.

JSON API: Return info

Discussion in 'Feature Requests' started by Matt, Aug 19, 2014.

  1. Matt

    Matt Forum Moderator & Contributor Staff Member Moderator Contributor

    Hello,

    I've discovered a cool plugin called, MC-JSONApi. It can return many info from the server using a JSON array that you can request. It works with a plugin. For example, a PHP script can log into that plugin with a login system that is built in.

    Now I'm wondering, would it be possible to add something like this, but than for LilyPad? So it'd return, for example, all the online servers. Or the server where a player is in. That'd be awesome! Many web-developers could play along with this to make a kinda User-Interface.
  2. The_Zip

    The_Zip Active Member Resource Contributor

  3. Matt

    Matt Forum Moderator & Contributor Staff Member Moderator Contributor

  4. flamin_scotsman

    flamin_scotsman New Member

    While it would be no insurmountable challenge to produce a json endpoint in the same manner as lilyflux - through a custom lilypad client, the actual data that you could expose through is a little sparse.

    Currently the connect server can only provide network information - latest proxy ip/port/version, current and max players across all proxies and current player names. If you wanted this api to also affect the network, you'd be able to send messages across to other lilypad clients, and to redirect players.

    Notably, all of the features you desired are currently not possible using only the connect server, you'd have to have plugins on each minecraft server which informed the json client when players joined and quit, along with some heartbeat signal to track when servers join and quit the network - in summary, a system at the core of quite a few bukkit plugins already.
  5. Amir Omidi

    Amir Omidi Member

    It shouldn't be hard to write a plugin that does this from the server.
  6. Tzeentchful

    Tzeentchful Member Contributor

    Like a few people have mentioned, you can have a look at the lilyflux thing i did. I collect the information in the collector.go file and put it into influxDB. It could easily be modified to host a web server where you can serve JSON requests instead. I am intending on expanding lilyflux to use the messaging system to communicate with a bukkit plugin so more detailed stats can be collected. I have just been very busy in studying for my degree and haven't had the time. Once i have done that i might make a branch of lilylflux and do something like you are wanting.
    If you have any questions about making a custom client for lilypad feel free to ask.
    Oh an you could also make your own standalone client using java if you aren't comfortable using golang.

Share This Page