npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@tomsith/node-red-contrib-minecraft

v0.7.7

Published

Node-RED nodes for Minecraft server RCON commands and status

Downloads

21

Readme

Node-RED Minecraft Integration

A comprehensive Node-RED package for interacting with Minecraft servers through RCON and Query protocols. This package provides nodes for server management, player control, world manipulation, and entity handling.

Table of Contents

  1. Configuration
  2. Available Nodes
  3. Node Usage
  4. Examples
  5. Troubleshooting

Configuration

Server Configuration Node (serverconfig)

This is a configuration node that stores your Minecraft server connection details.

Settings:

  • Host: Server IP address or hostname
  • RCON Port: RCON port (default: 25575)
  • RCON Password: RCON password from server.properties

Available Nodes

Basic Server Nodes

  • serverinfo: Gets server status information
  • servermanage: Handles server administration tasks
  • rcon: Sends raw RCON commands
  • volumebackup: Manages server volume backups

Player Nodes

  • playerinfo: Retrieves player-specific information
  • playermanage: Handles player management commands

World Nodes

  • world: Controls world-related settings
  • block: Manages blocks in the world
  • entity: Controls entities in the world

Node Usage

RCON Command Node (rcon)

Sends raw RCON commands to the server.

Input:

  • msg.payload: Raw Minecraft command (string)

Example:

msg.payload = "time set day";
return msg;

Server Info Node (serverinfo)

Gets server status information.

Output:

{
    "online": 5,          // Number of online players
    "max": 20,           // Maximum players
    "version": "1.19.2", // Server version
    "players": [         // Array of online players
        {"name": "Steve", "id": "..."}
    ]
}

Volume Backup Node (volumebackup)

Manages server volume backups.

Actions:

  • backup: Creates a backup
  • restore: Restores from backup

Input:

msg.action = "backup"; // or "restore"
msg.payload = "backup_name"; // optional

Player Management Node (playermanage)

Handles player-related commands.

Actions:

  • kick: Removes player from server
  • ban: Bans player from server
  • pardon: Unbans player
  • gamemode: Changes player gamemode
  • tp: Teleports player
  • give: Gives items to player
  • clear: Clears inventory
  • kill: Kills player
  • xp: Gives experience

Example:

// Kick player
msg.payload = "Steve";
msg.action = "kick";
msg.reason = "Taking a break";

// Give items
msg.payload = "diamond 64";
msg.action = "give";
msg.target = "Steve";

Player Info Node (playerinfo)

Retrieves player information.

Info Types:

  • health: Player health points
  • position: Player coordinates
  • inventory: Inventory contents
  • experience: XP level
  • gamemode: Current game mode
  • food: Food level
  • effects: Active effects
  • score: Scoreboard scores

Example:

msg.payload = "Steve";
msg.infoType = "health";
// Output: { "raw": "Steve has 20 health", "value": 20 }

World Management Node (world)

Controls world settings.

Actions:

  • time: Sets world time
  • weather: Controls weather
  • difficulty: Sets game difficulty
  • gamerule: Sets game rules
  • worldborder: Sets world border
  • setworldspawn: Sets world spawn point

Example:

msg.action = "weather";
msg.payload = "clear"; // clear, rain, thunder

Block Management Node (block)

Manages blocks in the world.

Actions:

  • set: Places a block
  • fill: Fills an area
  • clone: Copies blocks
  • info: Gets block data

Example:

msg.action = "set";
msg.payload = "0 64 0|stone"; // coordinates|block

Entity Management Node (entity)

Controls entities in the world.

Actions:

  • spawn: Creates entity
  • kill: Removes entities
  • count: Counts entities
  • info: Gets entity data
  • modify: Modifies entity NBT

Example:

msg.action = "spawn";
msg.payload = "zombie|~ ~2 ~|{CustomName:\"Boss\"}"; // entity|coordinates|nbt

Examples

Basic Server Monitor

[
    {
        "id": "status1",
        "type": "serverinfo",
        "server": "server-config-1",
        "name": "Server Status"
    },
    {
        "id": "debug1",
        "type": "debug"
    }
]

Automatic Day/Night Cycle

[
    {
        "id": "inject1",
        "type": "inject",
        "repeat": "300",
        "payload": "time set day",
        "payloadType": "str"
    },
    {
        "id": "rcon1",
        "type": "rcon",
        "server": "server-config-1"
    }
]

Player Join Notification

[
    {
        "id": "status1",
        "type": "serverinfo",
        "server": "server-config-1",
        "name": "Monitor Players"
    },
    {
        "id": "function1",
        "type": "function",
        "func": "let oldPlayers = context.get('players') || [];\nlet newPlayers = msg.payload.players;\nlet joined = newPlayers.filter(p => !oldPlayers.includes(p));\nif(joined.length > 0) {\n    msg.payload = `Players joined: ${joined.join(', ')}`;\n    context.set('players', newPlayers);\n    return msg;\n}"
    },
    {
        "id": "notify1",
        "type": "debug"
    }
]

Troubleshooting

Common Issues

  1. Connection Failed

    • Check if RCON is enabled in server.properties
    • Verify RCON port and password
    • Ensure server is running
  2. Command Failed

    • Check player names are correct
    • Verify coordinates are valid
    • Ensure command syntax is correct
  3. Parse Errors

    • Check NBT data format
    • Verify JSON syntax in messages
    • Ensure all required fields are provided

Debug Mode

Add a debug node to see detailed responses:

[
    {
        "id": "minecraft1",
        "type": "rcon"
    },
    {
        "id": "debug1",
        "type": "debug"
    }
]

Best Practices

  1. Error Handling

    • Use try-catch blocks
    • Check server responses
    • Validate input data
  2. Resource Management

    • Close RCON connections after use
    • Limit query frequency
    • Use appropriate timeouts
  3. Security

    • Store credentials in configuration nodes
    • Validate input data
    • Use appropriate player selectors

License

MIT License - feel free to use in your projects.