1.13.2 Sockets with web

Discussion in 'Spigot Plugin Development' started by Christophe6, Feb 6, 2020.

  1. Hi

    I’m trying to establish a connection between my website and my minecraft server. I’d like to display real time coordinates of the player that opened the website. I’m a little bit confused on how to achieve it. I think I shall do it with sockets but what should be the socket server? I guess it’ll be the minecraft server? Does anyone have any good tutorials or code snippets to help me?

    Thanks in advance!
  2. I suggest you to use some sort of RESTful API framework to build an api / websocket for that.
  3. I think it's possible with this.
    You create a websocket server and connect to it from your website with JavaScript and should be good to go.
  4. Thank you all for your replies. I’m a little bit confused though about which of the two should act like the server... Anyone who knows this?
  5. Benz56

    Moderator Supporter

    Your minecraft server is your server. The people on your website are the clients.

    https://stomp.github.io/ could work well for this as well. You can have people who open your website subscribe to a URL and whenever new data is published you can decide what to update via your JavaScript implementation.
  6. Note: websockets are different to sockets. You will *need* a websocket.