your current location:首页 > news>Integrated REST MINECRAFT

Integrated REST MINECRAFT

2024-12-12 09:26:00|Myriagame |source:minecraft skins

This module allows players to read and write power networks through the REST API.

This module adds only one square -HTTP agent, and players can control the integrated power network by setting up the web server to achieve very complicated automation control or some advanced functions.

Some examples (and some external codes) that may be implemented in this module:):

Control the lights of your room based on the daytime in your Minecraft world.

After receiving the email, play music or sound effects in Minecraft.

Show the position of all online players around the world on your website.

After Twitch or Mixer gets a new subscriber, open a door.

After the game is started, the 3000 port (configurable) will be opened locally to receive the HTTP request. The GET request is used to obtain information about the integrated power network and components. The post request is used to modify the value of the HTTP agent;

If you want to obtain information about a component, for example, the ID is 44, and you request http: // localhost: 3000/networklement/integrateddynamics/part/44. The information obtained is JSON format information:

 {"@Context": "https://raw.githubusercontent.com/cyclopsmc/integratedrest/master-12/main/resources/Context .jsonld "," @id":" Http: // localhost: 3000/"," networklements ": [{" @id ":" http: // localhost: 3000/networklement/integrateddynamics/part/44 "," POS POS iTion ": {" world ": 0, "x": -26, "y": 57, "z": -249, "size": "Ir: East"}, "block": "http: // localhost: 3000/registry/block/IntegratedDynamics/Cable "," @Type ": [" Networklement ",

"http: // localhost: 3000/registry/part/display_panel"], "Channel": 0, "Priority": 0, "UpdateInterval": 1, "Network": "http: // localhost: 3000/network/1619976862 ". Value ":" I was updated

via http! "," target ": {" world ": 0," x ": -25," y ": 57," z ": -249," side ":" Ir: west "

}, "Loaded": True}]}

In fact, this JSON belongs to JSON-LD (Linked Data Json, a link data format). You can get more information by continuing to access links in JSON-LD.

If you want to modify the value of an HTTP agent, for example, its ID is 7, you can request http: // localhost: 3000/networklement/integratedynamics/http/7;

For specific data types and corresponding methods, please see https://github.com/cyclopsmc/integratedrest/wiki/http-post-requests

The module cannot directly obtain the variable card value in the variable card through the HTTP request. The variable card can be placed in the display and fixed value, and the variable value can be obtained by obtaining the information of these components.