The CommandSender plugin allows you to send commands to the Minecraft server console via HTTP requests. This plugin is useful for automating server management tasks or integrating with other applications.
- Execute server commands via HTTP requests.
- Secure access with a configurable password.
- Reload configuration without restarting the server.
-
Download and Install the Plugin:
- Place the
CommandSender.jar
file in theplugins
directory of your Minecraft server.
- Place the
-
Configure the Plugin:
- Edit the
config.yml
file located in theplugins/CommandSender
directory. - Set the desired port and password for the HTTP server.
port: 4567 password: your_secure_password
- Edit the
-
Start the Server:¨
- Start or restart your Minecraft server to load the plugin.
You can use Node.js and the Axios library to send commands to the Minecraft server. Below is an example script:
import axios from 'axios';
const command = 'say ¡Hello World!'; // The command you want to execute
const password = 'testpass'; // Password
const url = 'http://37.27.125.25:25818/execute'; // The URL of the HTTP server
axios.post(url, null, {
headers: {
'password': password
},
params: {
'command': command
}
})
.then(response => {
console.log('Response:', response.data);
})
.catch(error => {
console.error('Error:', error.response ? error.response.data : error.message);
});
Explanation
- Command: The command to be executed on the Minecraft server.
- Password: The password set in the
config.yml
file to authenticate the request. - URL: The URL of the HTTP server running on your Minecraft serv
Running the Script
- Install Axios:
npm install axios
- Run the Script:
node your_script.js
Replaceyour_script.js
with the name of your script file.
The config.yml
file allows you to configure the plugin:
- port: The port on which the HTTP server will run.
- password: The password required to authenticate HTTP request
Example config.yml
:
port: 4567
password: your_secure_password
This project is licensed under the MIT License. See the LICENSE file for details.