'Is there any way of connecting minecraft javaPlugin to discord javaScript bot?
So basiclly, I was making a minecraft plugin, and I want to add function that alows you to log in into serwer in minecraft only if you are on discord. But i dont really know how can i call js from java.
Solution 1:[1]
Assuming your JS bot is written using a backend framework like NodeJS, There are many ways you could achieve this. The best way being to use WebSockets.
https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API
Solution 2:[2]
basically the only way i can do this is like that:
First of all, you have to get a database, and make a command in your js discord bot, for example !link <code>
, so basically what does that mean, after the player enters the Minecraft server it will automatically kick him and the display the code for link his discord account, and he just has to use the command that I mentioned before to link his account, this is really simple things you can easily make it with HashMap in java.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Hayden Taylor |
Solution 2 | omar ibrahim |