Get Steve's position in Minecraft

This is a short flow to demonstrate how to communicate from Node-RED with Minecraft. It uses a TCP request to push "player.getPos()\n" into Steve's world and will receive the coordinate tuple in a node.js buffer format that is converted .toString before printing in the debug panel. Note that you have to run Minecraft and enter a world before triggering this flow.

[{"id":"945e5f77.182da8","type":"function","z":"a59a50d2.5a65b","name":"function","func":"msg.payload = \"player.getPos()\\n\";\nreturn msg;","outputs":1,"noerr":0,"x":128,"y":153,"wires":[["ec2d4ccc.7365b","c5a42bac.ef9ba"]]},{"id":"c5a42bac.ef9ba","type":"debug","z":"a59a50d2.5a65b","name":"","active":true,"console":"false","complete":"false","x":378,"y":54,"wires":[]},{"id":"f1098e71.8eb9d","type":"inject","z":"a59a50d2.5a65b","name":"inject","topic":"","payload":"Hello World","payloadType":"string","repeat":"","crontab":"","once":false,"x":90,"y":54,"wires":[["945e5f77.182da8"]]},{"id":"ec2d4ccc.7365b","type":"tcp request","z":"a59a50d2.5a65b","server":"127.0.0.1","port":"4711","out":"char","splitc":"\\n","name":"","x":244,"y":253,"wires":[["f4f5b8bd.154d68"]]},{"id":"f4f5b8bd.154d68","type":"function","z":"a59a50d2.5a65b","name":"conversion","func":"msg.payload = msg.payload.toString();\nreturn msg;","outputs":1,"noerr":0,"x":367,"y":154,"wires":[["c5a42bac.ef9ba"]]}]

Flow Info

Created 9 years, 1 month ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • debug (x1)
  • function (x2)
  • inject (x1)
  • tcp request (x1)

Tags

  • Minecraft
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option