A Dart SDK for interacting with a Minecraft server using the RCON protocol. Package on pub.dev
Provides an API to connect to, log in to, send commands to, and receive data from a Minecraft server via the RCON protocol.
flutter pub add mc_rcon_dart or
dart pub add mc_rcon_dart.
Alternatively, add the following to your pubspec.yaml:
dependencies: mc_rcon_dart: ^1.1.0
Full code example in example.dart.
To import the package:
To create the socket (typically want to await on the completion):
createSocket("172.30.80.31", port: 25575);
To set a listener on the socket (note that the handler function must take a List
To log in to the RCON server:
To send any command:
sendCommand("time set 0");
To close the connection:
- The RCON documentation is here.
- The documentation for Minecraft console commands is here.
- The documentation for Socket (as of Dart 2.18.1), which is used to communicate with the RCON server, is here.
- Report bugs by making a new issue or send a merge request with the fix, but I'm pretty sure this is all working as is, and I don't expect the RCON protocol to change.