[SOLVED]How to connect webstie to SpongeForge server

Hello. I’m currently working on a SpongeForge RPG server with many mods and plugins. I want to make a website with shop ( buying ranks, items etc. ) for this server. I know the ASP .NET Core MVC ( C# ) framework which allow me create web app hosted on mostly any OS. But the problem is that I don’t know how to connect this web app with MInecraft server.
I want to know several things:

  • Is there any way on how I can add item to player inventory ( or just edit player balance etc. ) ? Using database, plugins… ?
  • How can I check if my server is online, and players can log into ?
  • How get the number of online players on the server ?

There are more question but all these question are mostly about how can I read server data, and modify them.
The best way to resolve all these questions would be to send commands to the server console, but don’t know how to do that too.
Maybe they are noob questions but I didn’t find anything which will help me. Thanks for any help and advice !

P.S: How to add user to group for a specified time using PermissionsEx ? Command pex user <user> group add <group> [world] [lifetime] from GitHub doesn’t work ( Too many arguments error ). Thanks !

1 Like

I don’t know anything about the shop stuff (I personally use Enjin’s Donationcraft), but I (and probably most other people) would suggest that you ditch PEX in favour of LuckPerms, PEX is basically abandoned, but LuckPerms is very active and very well maintained. It also has an updated and detailed wiki.

1 Like

You would pretty much want to get some kind of plugin that will expose an http rest API (as an example) that you can make requests to in order to grab or edit data. You might even be able to do something like RMI with this method. This of course requires such a plugin to exist.

1 Like

Hey there, it seems that the Web-API might be a good fit for what you’re looking for. It allows you to query and change various data of your minecraft server through JSON REST calls, and also comes with a handy admin panel (which you can turn off if you don’t need it) where you can manage your server and see what the API is capable of :slight_smile: The documentation is rather extensive aswell, which you can view here to get an idea of all the routes the Web-API offers.

(DISCLAIMER: I am the developer of Web-API)


Thanks for replies ! I have two ways to solve my problem:

I will probably use a second option because this plugin will allow me to create even more complex website for my server. Thanks @Valandur for great plugin !

P.S: Great community, gj all Sponge users !

1 Like