MinecraftConnectionBE 1.0.0-beta1
dotnet add package MinecraftConnectionBE --version 1.0.0-beta1
NuGet\Install-Package MinecraftConnectionBE -Version 1.0.0-beta1
<PackageReference Include="MinecraftConnectionBE" Version="1.0.0-beta1" />
paket add MinecraftConnectionBE --version 1.0.0-beta1
#r "nuget: MinecraftConnectionBE, 1.0.0-beta1"
// Install MinecraftConnectionBE as a Cake Addin #addin nuget:?package=MinecraftConnectionBE&version=1.0.0-beta1&prerelease // Install MinecraftConnectionBE as a Cake Tool #tool nuget:?package=MinecraftConnectionBE&version=1.0.0-beta1&prerelease
MinecraftConnectionBE
日本語版はこちら
MinecraftConnectionBE is a command sending library for MinecraftBE or Minecraft Education. It can be useful for automation and programming learning.
1. Preparation
First, launch MinecraftBE or Minecraft Education. In the settings section, set "Require Encrypted Websockets" to Off.
2. Create Project
This library is intended for .NET Standard 2.1 and above. This section describes how to create a .NET 6 console application.
Install MinecraftConnectionBE with the NuGet package manager, or run the following command in the package manager console.
Install-Package MinecraftConnectionBE -Version 1.0.0-beta1
or
dotnet add package MinecraftConnectionBE -v 1.0.0-beta1
3. Sample Programs
After running the program, use the /connect
command in Minecraft to connect to the server.
For example:
/connect 127.0.0.1:8080
3.1 Chat with AI
An OpenAI API key is always required to chat with an AI. If you have not obtained one, please click here to access and confirm it.
First, specify the IP address and port number to prepare the WebSocket server. Next, call the ChatAI()
method from the instance and assign the API key and the player ID to be conversed with, each as a string type. Using the Console.Readkey()
method, the server is open until a key is pressed.
using MinecraftConnectionBE;
using System.Net;
var address = IPAddress.Parse("127.0.0.1");
var port = 8080;
var apiKey = "<Your API key>";
var command = new MinecraftCommands(address, port);
command.AIChat(apiKey, "<Your ID>");
Console.ReadKey();
Result:
3.2 Send command
You can trigger a chat message to execute a specific command. Use the SubscribeCommand()
method to execute the command.
using MinecraftConnectionBE;
using System.Net;
var address = IPAddress.Parse("127.0.0.1");
var port = 8080;
var command = new MinecraftCommands(address, port);
command.SubscribeCommand("time set night", "night");
Console.ReadKey();
Result:
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- OpenAI (>= 1.7.2)
- System.Text.Json (>= 7.0.2)
- WebSocketSharp (>= 1.0.3-rc11)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0-beta1 | 96 | 4/22/2023 |
Beta release
- You can chat with them using the OpenAI API.
- The SubscribeCommand() method can be used to execute commands triggered by chat.