Command blocks are great for servers but they cannot connect to the outside web. Adding API blocks will make it easy for server creators to send and receive web data.
The system uses directional arrows just like chain command blocks.
First is the Request API block. When activated it sends an HTTP request like GET or POST to a web link. You can put a JSON payload in the block interface. You can also use targets like player names to send player info to the web service.
Second is the Response API block. You point the Request block arrow directly into this Response block. It waits for the web server to answer in the background so the server does not lag. When the web response arrives with JSON data, the Response block executes its commands and passes the incoming data into block entity tags or scoreboards.
To keep servers safe, add a whitelist setting in server properties so the block can only contact approved web addresses.
This block system will make custom maps and server tools much easier to build.
Please sign in to leave a comment.
0 Comments