mc_rcon_dart 1.1.0 copy "mc_rcon_dart: ^1.1.0" to clipboard
mc_rcon_dart: ^1.1.0 copied to clipboard

A Dart SDK for interacting with a Minecraft server using the RCON protocol.

example/example.dart

import 'dart:typed_data';
import 'package:mc_rcon_dart/mc_rcon_dart.dart';

main() async {
  await createSocket("172.30.80.31", port: 25575); // Replace RCON server info.
  listen(onData);
  login("123"); // Replace password to the RCON server.
  sendCommand("time set 0"); // This can be any valid Minecraft console command.
  close();
}

void onData(List<int> header, String payload) {
  print("Message length: ${header[0]}");
  print("Response ID: ${header[1]}");
  print("Command ID: ${header[2]}");
  print("Response payload: $payload");
}
12
likes
140
pub points
0%
popularity

Publisher

verified publisherlok.ninja

A Dart SDK for interacting with a Minecraft server using the RCON protocol.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on mc_rcon_dart