Updated documentation to the latest state

This commit is contained in:
Anon 2026-03-22 15:40:05 +01:00
parent 9613e0df51
commit e4aeb51f71
12 changed files with 149 additions and 3268 deletions

View file

@ -18,6 +18,6 @@ features:
- title: Automation
details: Create bots to do automated tasks
- title: Supported Versions
details: 1.4 - 1.20.4
details: 1.4.6 - 1.21.11
footer: Made by MCC Team with ❤️
---

View file

@ -24,9 +24,9 @@ title: About & Features
## About
**Minecraft Console Client (MCC)** is a lightweight cross-platform open-source **Minecraft** TUI client for **Java edition** that allows you to connect to any Minecraft Java server, send commands and receive text messages in a fast and easy way without having to open the main Minecraft game.
**Minecraft Console Client (MCC)** is a lightweight, cross-platform, open-source **Minecraft** TUI client for **Java Edition**. It lets you connect to Minecraft Java servers, send commands, and receive text messages without launching the main game.
It also provides various automations that you can enable for administration and other purposes, as well as extensible C# API for creating Bots.
It also includes built-in automation for administration and utility work, plus an extensible C# API for creating bots and runtime scripts.
It was originally made by [ORelio](https://github.com/ORelio) in 2012 on the [Minecraft Forum](http://www.minecraftforum.net/topic/1314800-/), now it's maintained by him and many other contributors from the community.
@ -57,7 +57,7 @@ It was originally made by [ORelio](https://github.com/ORelio) in 2012 on the [Mi
- [Terrain Traversing](usage.md#move)
- Entity Handling
_NOTE: Some of mentioned features are disabled by default and you will have to turn them on in the configuration file and some may require additional configuration on your part for your specific usage._
_Note: Some of these features are disabled by default. You need to enable them in the configuration file, and some also require additional setup._
## Why Minecraft Console Client?
@ -74,7 +74,7 @@ _NOTE: Some of mentioned features are disabled by default and you will have to t
## Quick Intro
Don't have time to read through the documentation, we got you, our community has made some simple introduction videos about the **Minecraft Console Client**.
If you do not want to read through the documentation right away, the community has made a few short introduction videos for **Minecraft Console Client**.
### The list of the tutorials:
@ -90,7 +90,7 @@ Using Commands, Scripts and other features:
## Getting Help
MCC has a community that is willing to help, we have a Discussions section in out Git Hub repository.
MCC has an active community, and the GitHub Discussions section is the best place to ask for help.
Click [here](https://github.com/MCCTeam/Minecraft-Console-Client/discussions) to access it.
@ -101,13 +101,13 @@ Click [here](https://github.com/MCCTeam/Minecraft-Console-Client/discussions) to
## Bugs, Ideas, Feature Requests
Bug reporting, idea submitting or feature requesting are done in the [Issues](https://github.com/MCCTeam/Minecraft-Console-Client/issues) section of our [Github repository]([here](https://github.com/MCCTeam/Minecraft-Console-Client)).
Bug reports, ideas, and feature requests all go through the [Issues](https://github.com/MCCTeam/Minecraft-Console-Client/issues) section of our [GitHub repository](https://github.com/MCCTeam/Minecraft-Console-Client).
Navigate to the Issues section, search for a bug, idea or a feature using the search option here in the documentation and in the `Issues` section on Git Hub before making your own.
Before opening a new issue, search both the documentation and the `Issues` section to avoid duplicates.
If you haven't found anything similar, go ahead and click on the `New issue` button, then choose what you want to do.
If you do not find anything similar, click `New issue` and choose the appropriate template.
If you're reporting a bug, please be descriptive as much as possible, try to explain how to re-create the bug, attack screenshots and logs, make sure that you have [`debugmessages`](configuration.me#debugmessages) set to `true` before sending a bug report or taking a screenshot.
If you are reporting a bug, be as specific as possible. Explain how to reproduce it, attach screenshots and logs, and make sure debug logging is enabled before collecting them.
### Before submitting
@ -122,20 +122,22 @@ If you want the repeatable agent workflow used by maintainers, start with [AI-As
### Inventory, Terrain and Entity Handling
Inventory handling is currently not supported in versions: `1.4.6 - 1.9` (*The inventory handling code is in the place, but we're missing Item Palettes, on which we're working.*)
MCC currently supports Minecraft versions `1.4.6` through `1.21.11`.
Terrain handling is currently not supported in versions: `1.4.6 - 1.6`
Feature support still depends on protocol version:
Entity handling is currently not supported in versions: `1.4.6 - 1.7`
- Inventory handling is supported on `1.8+`.
- Terrain handling is supported on `1.7.2+`.
- Entity handling is supported on `1.8+`.
There features might not always be implemented in the latest version of the game, since they're often subjected to major changes by Mojang, and we need some time to figure out what has changed and to implement the required changes.
These features may lag behind brand-new Minecraft releases when Mojang changes the protocol or registries in a major way.
If there was a major game update, and the MCC hasn't been updated to support these features, if you're a programmer, feel free to contribute to the project.
### Path-Finding and Physics
Currently the path-finding and physics have some limitations, those are:
- Path finding under slabs is not supported (currently being worked on, partialy complete but not avaliable in the main branch)
- Path finding under slabs is not supported
- Swimming is not supported yet
- Jumping is not supported yet
- Knockback is not supported yet
@ -197,7 +199,7 @@ We remind you that **you may get banned** by your server for using this program.
Minecraft Console Client is a totally free of charge, open source project.
The source code is available at [Github Repository](https://github.com/MCCTeam/Minecraft-Console-Client)
The source code is available at the [GitHub repository](https://github.com/MCCTeam/Minecraft-Console-Client)
Unless specifically stated, source code is from the MCC Team or Contributors, and available under CDDL-1.0.

View file

@ -17,7 +17,6 @@ redirectFrom:
<div class="custom-container warning"><p class="custom-container-title">Warning</p>
**Recently we have changed the configuration format from INI to TOML, this part of the documentation has only been partially updated, it's work in progress, for the time being please refer to the `MinecraftClient.ini` for setting names, the descriptions and options should be up to date in most cases, but not guaranteed.**
</div>
@ -29,30 +28,32 @@ redirectFrom:
## List of built-in Chat Bots
- [Alerts](#alerts)
- [Anti AFK](#anti-afk)
- [Auto Attack](#auto-attack)
- [Auto Craft](#auto-craft)
- [Auto Dig](#auto-dig)
- [Auto Drop](#auto-drop)
- [Auto Eat](#auto-eat)
- [Auto Fishing](#auto-fishing)
- [Auto Relog](#auto-relog)
- [Auto Respond](#auto-respond)
- [Chat Log](#chat-log)
- [Discord Bridge](#discord-bridge)
- [Farmer](#farmer)
- [Follow Player](#follow-player)
- [Hangman](#hangman)
- [Mailer](#mailer)
- [Map](#map)
- [PlayerList Logger](#playerlist-logger)
- [Remote Control](#remote-control)
- [Replay Mod](#replay-mod)
- [Script Scheduler](#script-scheduler)
- [Telegram Bridge](#telegram-bridge)
- [Items Collector](#items-collector)
- [WebSocket](#websocket-chat-bot)
- [Chat Bots](#chat-bots)
- [About](#about)
- [List of built-in Chat Bots](#list-of-built-in-chat-bots)
- [Alerts](#alerts)
- [Anti AFK](#anti-afk)
- [Auto Attack](#auto-attack)
- [Auto Craft](#auto-craft)
- [Auto Dig](#auto-dig)
- [Auto Drop](#auto-drop)
- [Auto Eat](#auto-eat)
- [Auto Fishing](#auto-fishing)
- [Auto Relog](#auto-relog)
- [Auto Respond](#auto-respond)
- [Chat Log](#chat-log)
- [Discord Bridge](#discord-bridge)
- [Farmer](#farmer)
- [Follow player](#follow-player)
- [Hangman](#hangman)
- [Mailer](#mailer)
- [Map](#map)
- [PlayerList Logger](#playerlist-logger)
- [Remote Control](#remote-control)
- [Replay Capture](#replay-capture)
- [Script Scheduler](#script-scheduler)
- [Telegram Bridge](#telegram-bridge)
- [Items Collector](#items-collector)
## Alerts
@ -347,7 +348,7 @@ redirectFrom:
To enable it, set `Custom` (boolean) to `true` and change `value` (double) to your preferred value (eg. `1.5`).
By the default, this is disabled and the MCC calculates it based on the server TPS.
By default, this is disabled and MCC calculates it based on the server TPS.
- **Format:** `Cooldown_Time = { Custom = <is enabled (true|false)>, value = <seconds (double)> }`
@ -2576,70 +2577,3 @@ redirectFrom:
- **Default:** `true`
## WebSocket Chat Bot
- **Description:**
This chat bot allows you to remotely execute commands on the MCC and make Chat Bots in other programming languages over Web Socket.
You can make your own library to do this, or use the reference implementation one which has been writen in TypeScript/JavaScript: [MCC.js](https://github.com/milutinke/MCC.js)
If you want to write your own library, you can follow this guide on the protocol specification and avaliable events and commands: [WebSocket Chat Bot Guide](websocket/README.md)
- **Settings:**
**Section:** **`ChatBot.WebSocketBot`**
#### `Enabled`
- **Description:**
This setting specifies if the Web Socket chat bot is enabled.
- **Available values:** `true` and `false`.
- **Type:** `boolean`
- **Default:** `false`
#### `Ip`
- **Description:**
The IP address that Websocket server will be bound to.
- **Type:** `string`
- **Default:** `127.0.0.1` (localhost)
#### `Port`
- **Description:**
The Port that Websocket server will be bound to.
- **Type:** `number`
- **Default:** `8043`
#### `Password`
- **Description:**
A password that will be used to authenticate on thw Websocket server
**It is recommended to change the default password and to set a strong one**
- **Type:** `string`
- **Default:** `wspass12345`
#### `DebugMode`
- **Description:**
This setting is for developers who are developing a library that uses this chat bot to remotely execute procedures/commands/functions.
- **Type:** `boolean`
- **Default:** `false`

View file

@ -7,34 +7,33 @@ redirectFrom:
# Configuration
**Minecraft Console Client** can be both configured by the [command line parameters](usage.md#command-line-parameters) and the configuration file.
**Minecraft Console Client** can be configured through both [command-line parameters](usage.md#command-line-parameters) and the configuration file.
By the default all of the configurations are stored in the configuration file named `MinecraftClient.ini` which is created the first time you run the program, but you also can specify your own configuration file by providing a path to it as a first parameter when starting the MCC, check out [Usage](usage.md#quick-usage-of-mcc-with-examples) for examples.
By default, MCC stores its settings in `MinecraftClient.ini`, which is created the first time you run the program. You can also pass a custom configuration file path as the first argument when starting MCC. See [Usage](usage.md#quick-usage-of-mcc-with-examples) for examples.
<div class="custom-container warning"><p class="custom-container-title">Warning</p>
**Recently we have changed the configuration format from INI to TOML, the documentation had to be updated. If you spot a mistake, please report it on our Discord or in the repository as an issue.**
</div>
## Notes
- Some settings will be omitted from the documentation due to them being not used often, we do not want documentation to be cluttered, we advise you to manually read through the configuration file, where every setting has a description next to it.
- Some plugin/bot related settings will be covered in the plugins section, not here
- Some less common settings are not repeated here. The generated config file contains inline descriptions for every setting.
- Bot-specific settings are documented in [Chat Bots](chat-bots.md).
## Configuration File
### Format
The configuration file uses the [TOML format](https://toml.io/en/), all of the options are key-value pairs separated into sections.
The configuration file uses the [TOML format](https://toml.io/en/). Options are key-value pairs grouped into sections.
Sections are defined in-between the square brackets (Example: `[This is a section]`), each occurrence of this marks a beginning of a new section.
Sections are defined between square brackets, for example `[This is a section]`.
The settings/options are defined as key-value pairs, where the name of the setting and the value are separated by the equals sign `=` (Example: `some-setting=some value`).
Settings are written as key-value pairs, with the key and value separated by `=`, for example `some-setting = "some value"`.
Lines starting with `#` are comments, they do not have an effect on the configuration of the program, their purpose is purely a descriptive one.
**To get familiar with all the data types and styles of settings please read the [official TOML documenation](https://toml.io/en/v1.0.0).**
**For the full syntax and data types, see the [official TOML documentation](https://toml.io/en/v1.0.0).**
Full Example:
@ -52,7 +51,7 @@ Section_Enabled = true
colors = [ "red", "yellow", "green" ]
[ThirdSection.Subsection]
Coordinate = { x = 145, y = 64, y = 2045 }
Coordinate = { x = 145, y = 64, z = 2045 }
```
## Main Section
@ -107,11 +106,11 @@ Coordinate = { x = 145, y = 64, y = 2045 }
- **Description:**
This setting is where you define the type of your account: `mojang` or `microsoft`
This setting defines the account type: `mojang`, `microsoft`, or `yggdrasil`.
<div class="custom-container tip"><p class="custom-container-title">Tip</p>
**Mojang accounts are going to stop working soon for everyone, they already are not working for some people.**
**Use `microsoft` for normal Microsoft accounts. `yggdrasil` is for custom authlib/Yggdrasil servers.**
</div>
@ -159,12 +158,12 @@ Coordinate = { x = 145, y = 64, y = 2045 }
- **Type:** `string`
- **Default:** `en_gb`
- **Default:** `en_us`
- **Example:**
```
Language = "en_gb"
Language = "en_us"
```
#### `ConsoleTitle`
@ -268,7 +267,7 @@ Coordinate = { x = 145, y = 64, y = 2045 }
<div class="custom-container tip"><p class="custom-container-title">Tip</p>
**MCC supports only 1.4.6 - 1.19.2**
**Current code support is `1.4.6` through `1.21.11`.**
</div>
@ -286,7 +285,7 @@ Coordinate = { x = 145, y = 64, y = 2045 }
- `no`
- `force`
- **Default:** `auto`
- **Default:** `no`
<div class="custom-container tip"><p class="custom-container-title">Tip</p>

View file

@ -4,11 +4,11 @@ title: Contributing
# Contributing
At this moment this page needs to be created.
This page is still being filled in. For now, use the links below for the current contributor workflow.
If you are working with SWE AI agents, start with [AI-Assisted Development](ai-assisted-development.md). It covers the shell setup, local server loop, and the skills in `.skills/`.
For now you can use our article from the [Git Hub repository Wiki](https://github.com/MCCTeam/Minecraft-Console-Client/wiki/Update-console-client-to-new-version) written by [ReinforceZwei](https://github.com/ReinforceZwei).
You can also use the guide in the [GitHub repository wiki](https://github.com/MCCTeam/Minecraft-Console-Client/wiki/Update-console-client-to-new-version) written by [ReinforceZwei](https://github.com/ReinforceZwei).
## Translations
@ -16,12 +16,12 @@ To improve translations for MCC, please visit: [Crowdin - Minecraft Console Clie
**It is recommended to translate `MCC in-app text` first.**
If you can't find the language you want to translate into, please contact us at Github or Discord to add it.
If you cannot find the language you want to translate into, contact us on GitHub or Discord and we can add it.
Github: <a href="https://github.com/MCCTeam/Minecraft-Console-Client" rel="nofollow noopener" target="_blank">https://github.com/MCCTeam/Minecraft-Console-Client</a>
GitHub: <a href="https://github.com/MCCTeam/Minecraft-Console-Client" rel="nofollow noopener" target="_blank">https://github.com/MCCTeam/Minecraft-Console-Client</a>
Discord: <a href="https://discord.gg/9HPr2EE4C4" rel="nofollow noopener" target="_blank">https://discord.gg/9HPr2EE4C4</a>
## Contributors
[Check out our contributors on Github](https://github.com/MCCTeam/Minecraft-Console-Client/graphs/contributors).
[Check out our contributors on GitHub](https://github.com/MCCTeam/Minecraft-Console-Client/graphs/contributors).

View file

@ -14,7 +14,7 @@ title: Creating Chat Bots
<div class="custom-container tip"><p class="custom-container-title">Tip</p>
**For now this page contains only the bare basics of the Chat Bot API, enough of details to teach you how to make basic Chat Bots. For more details you need to take a look at the [ChatBot.cs](https://github.com/MCCTeam/Minecraft-Console-Client/blob/master/MinecraftClient/Scripting/ChatBot.cs) and [Examples](#examples). This page will be improved in the future.**
**This page covers the basics of the Chat Bot API. For the full surface area, read [ChatBot.cs](https://github.com/MCCTeam/Minecraft-Console-Client/blob/master/MinecraftClient/Scripting/ChatBot.cs) and the example scripts linked below.**
</div>
@ -42,7 +42,7 @@ This introduction assumes that you have the basic knowledge of C#.
<div class="custom-container tip"><p class="custom-container-title">Tip</p>
**Here we will use terms Chat Bot and Script interchangeably**
**In this page, "Chat Bot" and "Script" are used interchangeably.**
</div>
@ -59,8 +59,8 @@ MCC.LoadBot(new ExampleChatBot());
// The code and comments above are defining a "Script Metadata" section
// Every single chat bot (script) must be a class which extends the ChatBot class.
// Your class must be instantiates in the "Script Metadata" section and passed to MCC.LoadBot function.
// Every chat bot script must define a class that extends ChatBot.
// Instantiate that class in the script metadata section and pass it to MCC.LoadBot.
class ExampleChatBot : ChatBot
{
// This method will be called when the script has been initialized for the first time, it's called only once
@ -92,7 +92,7 @@ class ExampleChatBot : ChatBot
Start MCC, connect to a server and run the following internal command: `/script ExampleChatBot.cs`.
If you did everything right you should see: `[Example Chat Bot] An example Chat Bot has been initialised!` message appear in your console log.
If everything worked, you should see `[Example Chat Bot] An example Chat Bot has been initialized!` in the console.
### Structure of Chat Bots
@ -111,9 +111,9 @@ Every single Chat Bot (Script) must have this section at the beginning in order
`//MCCScript 1.0` marks the beginning of the **Script Metadata** section, this must always be on the first line or the Chat Bot (Script) will not load and will throw an error.
`//MCCScript Extensions` marks the end of the **Script Metadata** section, this must be defined before a Chat Bot (Script) class.
`//MCCScript Extensions` marks the end of the **Script Metadata** section. It must appear before the Chat Bot class.
In order for your Chat Bot (Script) to properly load in-between the `//MCCScript 1.0` and the `//MCCScript Extensions` lines you must instantiate your Chat Bot (Script) class and pass it to the `MCC.LoadBot` function.
To load a Chat Bot script, instantiate the bot class between `//MCCScript 1.0` and `//MCCScript Extensions`, then pass it to `MCC.LoadBot`.
Example code:
@ -121,7 +121,7 @@ Example code:
MCC.LoadBot(new YourChatBotClassNameHere());
```
**Script Metadata** section allows for including C# packages and libraries with: `//using <namespace>` and `/dll <dll name>`.
The **Script Metadata** section also lets you include namespaces and DLL references with `//using <namespace>` and `//dll <dll name>`.
<div class="custom-container tip"><p class="custom-container-title">Tip</p>
@ -129,7 +129,7 @@ MCC.LoadBot(new YourChatBotClassNameHere());
</div>
By the default the following packages are loaded:
By default, the following namespaces are loaded:
```csharp
using System;
@ -167,28 +167,28 @@ MCC.LoadBot(new ExampleChatBot());
### Chat Bot Class
After the end of the **Script Metadata** section, you basically can define any number of classes you like, the only limitation is that the main class of your Chat Bot (Script) must extend `ChatBot` class.
After the **Script Metadata** section, you can define any number of helper classes. The main bot class must extend `ChatBot`.
There are no required methods, everything is optional.
When the Chat Bot (Script) has been initialized for the first time the `Initialize` method will be called.
When the Chat Bot is initialized for the first time, the `Initialize` method is called.
In it you can initialize variables, eg. Dictionaries, etc..
Use it to initialize state such as dictionaries or cached values.
<div class="custom-container tip"><p class="custom-container-title">Tip</p>
**For allocating resources like a database connection, we recommend allocating them in `AfterGameJoined` and freeing them in `OnDisconnect`**
</div>.
</div>
## Examples
You can find a lot of examples in our Git Hub Repository at [ChatBots](https://github.com/MCCTeam/Minecraft-Console-Client/tree/master/MinecraftClient/ChatBots) and [config](https://github.com/MCCTeam/Minecraft-Console-Client/tree/master/MinecraftClient/config).
You can find more examples in the [ChatBots](https://github.com/MCCTeam/Minecraft-Console-Client/tree/master/MinecraftClient/ChatBots) and [config](https://github.com/MCCTeam/Minecraft-Console-Client/tree/master/MinecraftClient/config) folders in the GitHub repository.
## C# API
As of the time of writing, the C# API has been changed in forks that are yet to be merged, so for now you can use the [ChatBot.cs](https://github.com/MCCTeam/Minecraft-Console-Client/blob/master/MinecraftClient/Scripting/ChatBot.cs) for reference.
The authoritative reference for the C# API is [ChatBot.cs](https://github.com/MCCTeam/Minecraft-Console-Client/blob/master/MinecraftClient/Scripting/ChatBot.cs).
Each method is well documented with standard C# documentation comments.
In the future we will make a script to auto-generate this section based on the documentation in the code.
This page intentionally stays focused on the basics. For newer hooks and overloads, check the source file directly.

View file

@ -4,9 +4,9 @@ title: Creating Simple Script
# Creating Simple Script
A simple script is a text file with one command per line. See [Internal Commands](https://mccteam.github.io/guide/usage.html#internal-commands) section or type `/help` in the console to see available commands. Any line beginning with `#` is ignored and treated as a comment.
A simple script is a text file with one command per line. See the [Internal Commands](usage.md#internal-commands) section, or type `/help` in the console to see the available commands. Any line beginning with `#` is ignored and treated as a comment.
Application variables defined using the set command or [AppVars] INI section can be used. The following read-only variables can also be used: `%username%, %login%, %serverip%, %serverport%, %datetime%`
Application variables defined with the `set` command or in the `[AppVars]` config section can be used. The following read-only variables are also available: `%username%`, `%login%`, `%serverip%`, `%serverport%`, `%datetime%`.
## Example
@ -21,6 +21,6 @@ send Now quitting. Bye :)
exit
```
Go to [example scripts](https://github.com/MCCTeam/Minecraft-Console-Client/tree/master/MinecraftClient/config) to see more example.
See the [example scripts](https://github.com/MCCTeam/Minecraft-Console-Client/tree/master/MinecraftClient/config) folder for more examples.
If you want need advanced functions, please see [Creating Chat Bots](creating-bots.md)
If you need more advanced behavior, see [Creating Chat Bots](creating-bots.md).

View file

@ -20,7 +20,7 @@ If you're not the kind of person that likes textual tutorials, our community has
## Download a compiled binary
You can download a compiled binary file of the latest build from our Releases section on Git Hub: [Download](https://github.com/MCCTeam/Minecraft-Console-Client/releases)
You can download a compiled binary of the latest build from the [GitHub Releases](https://github.com/MCCTeam/Minecraft-Console-Client/releases) page.
## Building from the source code
@ -33,7 +33,7 @@ However, if you want to build the program from source code, please follow the gu
Requirements:
- [Git](https://www.git-scm.com/)
- [.NET 7.0 or new-er](https://dotnet.microsoft.com/en-us/download) or [Visual Studio](https://visualstudio.microsoft.com/) configured for C# app development
- [.NET 10 SDK](https://dotnet.microsoft.com/en-us/download) or [Visual Studio](https://visualstudio.microsoft.com/) configured for C# app development
<div class="custom-container tip"><p class="custom-container-title">Tip</p>
@ -48,12 +48,18 @@ Install [Git](https://www.git-scm.com/)
1. Make a new folder where you want to keep the source code
2. Then open it up, hold `SHIFT` and do a `right-click` on the empty white space in the folder
3. Click on `Git Bash Here` in the context menu
4. Clone the [Git Hub Repository](https://github.com/MCCTeam/Minecraft-Console-Client) by typing end executing the following command:
4. Clone the [GitHub repository](https://github.com/MCCTeam/Minecraft-Console-Client) by running:
```bash
git clone https://github.com/MCCTeam/Minecraft-Console-Client.git --recursive
```
If you cloned the repository without `--recursive`, run:
```bash
git submodule update --init --recursive
```
5. Once the repository has been cloned, you can close the `Git Bash` terminal emulator
6. Open up the new cloned folder
@ -83,7 +89,7 @@ git clone https://github.com/MCCTeam/Minecraft-Console-Client.git --recursive
6. Right click on `MinecraftClient` solution in the `Solution Explorer`
7. Click `Build`
If the build has succeeded, the compiled binary `MinecraftClient.exe` will be in `MinecraftClient/bin/Release/net7.0/win-x64/publish` folder.
If the build succeeds, the published binary `MinecraftClient.exe` will be in `MinecraftClient/bin/Release/net10.0/win-x64/publish/`.
#### Building using .NET manually without Visual Studio
@ -92,10 +98,10 @@ If the build has succeeded, the compiled binary `MinecraftClient.exe` will be in
3. Run the following command to build the project:
```bash
dotnet publish MinecraftClient -f net7.0 -r win-x64 --no-self-contained -c Release -p:UseAppHost=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=None
dotnet publish MinecraftClient.sln -f net10.0 -r win-x64 --self-contained=true -c Release -p:UseAppHost=true -p:IncludeNativeLibrariesForSelfExtract=true -p:EnableCompressionInSingleFile=true -p:DebugType=Embedded
```
If the build has succeeded, the compiled binary `MinecraftClient.exe` will be in `MinecraftClient/bin/Release/net7.0/win-x64/publish` folder.
If the build succeeds, the published binary `MinecraftClient.exe` will be in `MinecraftClient/bin/Release/net10.0/win-x64/publish/`.
### Linux, macOS
@ -113,7 +119,7 @@ Requirements:
- [Install Git on macOS](https://git-scm.com/download/mac)
- .NET SDK 7.0 or new-er
- .NET 10 SDK
- [Install .NET on Linux](https://docs.microsoft.com/en-us/dotnet/core/install/linux)
- [Install .NET on macOS](https://docs.microsoft.com/en-us/dotnet/core/install/macos)
@ -121,7 +127,7 @@ Requirements:
#### Cloning using Git
1. Open up a terminal emulator and navigate to the folder where you will store the MCC
2. Recursively clone the [Git Hub Repository](https://github.com/MCCTeam/Minecraft-Console-Client) by typing end executing the following command:
2. Recursively clone the [GitHub repository](https://github.com/MCCTeam/Minecraft-Console-Client) by running:
```bash
git clone https://github.com/MCCTeam/Minecraft-Console-Client.git --recursive
@ -134,31 +140,31 @@ git clone https://github.com/MCCTeam/Minecraft-Console-Client.git --recursive
- On Linux:
```bash
dotnet publish MinecraftClient -f net7.0 -r linux-x64 --no-self-contained -c Release -p:UseAppHost=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=None
dotnet publish MinecraftClient.sln -f net10.0 -r linux-x64 --self-contained=true -c Release -p:UseAppHost=true -p:IncludeNativeLibrariesForSelfExtract=true -p:EnableCompressionInSingleFile=true -p:DebugType=Embedded
```
<div class="custom-container tip"><p class="custom-container-title">Tip</p>
**If you're using Linux that is either ARM, 32-bit, Rhel based, Using Musl, or Tirzen, [find an appropriate RID](https://docs.microsoft.com/en-us/dotnet/core/rid-catalog#linux-rids) for your platform and replace the `-r linux-64` with an appropriate `-r RID_NAME` (Example for arm: `-r linux-arm64`)**
**If you are using Linux on ARM, 32-bit, RHEL-based distributions, or Musl, [pick the appropriate RID](https://learn.microsoft.com/en-us/dotnet/core/rid-catalog#linux-rids) for your platform and replace `-r linux-x64` with it, for example `-r linux-arm64`.**
</div>
- On macOS:
```bash
dotnet publish MinecraftClient -f net7.0 -r osx-x64 --no-self-contained -c Release -p:UseAppHost=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=None
dotnet publish MinecraftClient.sln -f net10.0 -r osx-x64 --self-contained=true -c Release -p:UseAppHost=true -p:IncludeNativeLibrariesForSelfExtract=true -p:EnableCompressionInSingleFile=true -p:DebugType=Embedded
```
<div class="custom-container tip"><p class="custom-container-title">Tip</p>
**If you're not using MAC with Intel, find an appropriate RID for your ARM processor, [find an appropriate RID](https://docs.microsoft.com/en-us/dotnet/core/rid-catalog#macos-rids) and replace the `-r osx-64` with an appropriate `-r RID_NAME` (Example for arm: `-r osx.12-arm64`)**
**If you are not using an Intel Mac, [pick the appropriate RID](https://learn.microsoft.com/en-us/dotnet/core/rid-catalog#macos-rids) for your processor and replace `-r osx-x64` with it, for example `-r osx-arm64`.**
</div>
If the build has succeeded, the compiled binary `MinecraftClient` will be in:
- Linux: `MinecraftClient/bin/Release/net7.0/linux-x64/publish/`
- macOS: `MinecraftClient/bin/Release/net7.0/osx-x64/publish/`
- Linux: `MinecraftClient/bin/Release/net10.0/linux-x64/publish/`
- macOS: `MinecraftClient/bin/Release/net10.0/osx-x64/publish/`
## Using Docker
@ -175,11 +181,11 @@ Requirements:
<div class="custom-container warning"><p class="custom-container-title">Warning</p>
**Pay attention at warnings, Docker currently works, but you must start the containers in the interactive mode or MCC will crash, we're working on solving this.**
**Docker works, but you need to start the container in interactive mode. Starting it in headless mode can still crash MCC.**
</div>
1. Clone the [Git Hub Repository](https://github.com/MCCTeam/Minecraft-Console-Client) by typing end executing the following command:
1. Clone the [GitHub repository](https://github.com/MCCTeam/Minecraft-Console-Client) by running:
```bash
git clone https://github.com/MCCTeam/Minecraft-Console-Client.git --recursive
@ -196,12 +202,12 @@ docker build -t minecraft-console-client:latest .
<div class="custom-container danger"><p class="custom-container-title">Danger</p>
**There is a bug with the ConsoleInteractive which causes a crash when a container is started in a headless mode, so you need to use the interactive mode. Do not restart containers in a classic way, stop then and start them with interactive mode (this command), after that simply detach with `CTRL + P` and then `CTRL + Q`.**
**Because of a ConsoleInteractive issue, starting the container in headless mode can crash MCC. Start it with the interactive command below, then detach with `CTRL + P` followed by `CTRL + Q` if you want to leave it running in the background.**
</div>
```bash
# You could also ignore the -v parameter if you dont want to mount the volume that is up to you. If you don't it's harder to edit the .ini file if thats something you want to do
# You can omit -v if you do not want a mounted volume. Keeping the volume makes it much easier to edit the TOML config stored in MinecraftClient.ini from the host.
docker run -it -v <PATH_ON_YOUR_MACHINE_TO_MOUNT>:/opt/data minecraft-console-client:latest
```
@ -234,11 +240,11 @@ Remember to remove the container after usage:
docker-compose down
```
If you use the INI file and entered your data (username, password, server) there, you can start your container using
If you use `MinecraftClient.ini` and entered your data there, you can start your container using
```bash
docker-compose up
docker-compose up -d #for deamonized running in the background
docker-compose up -d # for daemonized background running
```
Note that you won't be able to interact with the client using `docker-compose up`. If you want that functionality, please use the first method: `docker-compose run MCC`.
@ -251,11 +257,11 @@ docker-compose down
## Run on Android
It is possible to run the Minecraft Console Client on Android through Termux and Ubuntu 22.04 in it, however it requires a manual setup with a lot of commands, be careful no to skip any steps. Note that this might take anywhere from 10 to 20 minutes or more to do depending on your technical knowledge level, Internet speed and CPU speed.
It is possible to run Minecraft Console Client on Android through Termux and Ubuntu 22.04, but it requires a manual setup with a lot of commands, so be careful not to skip any steps. Depending on your technical background, internet speed, and device speed, this can take anywhere from 10 to 20 minutes or more.
<div class="custom-container tip"><p class="custom-container-title">Tip</p>
**This section is going to get a bit technical, I'll try my best to make everything as simple as possible. If you are having trouble following along or if you encounter any issues, feel free to open up a discussion on our Github repository page.**
**This section gets a bit technical. If you run into issues, open a discussion on our GitHub repository page.**
</div>
@ -277,11 +283,11 @@ It is possible to run the Minecraft Console Client on Android through Termux and
<div class="custom-container warning"><p class="custom-container-title">Warning</p>
**The Play Store version of Termux is outdated and not supported, do not use it, use the the [Github one](https://github.com/termux/termux-app/releases/latest/).**
**The Play Store version of Termux is outdated and not supported. Use the [GitHub release](https://github.com/termux/termux-app/releases/latest/) instead.**
</div>
Go to [the Termux Github latest release](https://github.com/termux/termux-app/releases/latest/), download the `debug_universal.apk`, unzip it and run it.
Go to [the latest Termux GitHub release](https://github.com/termux/termux-app/releases/latest/), download the `debug_universal.apk`, unzip it, and run it.
<div class="custom-container tip"><p class="custom-container-title">Tip</p>
@ -350,7 +356,7 @@ Once the installation is complete, you can start Ubuntu with:
#### Installing .NET on ARM
Since there are issues installing .NET 7.0 via the APT package manager at the time of writing, we will have to install it manually.
If the package-manager route does not provide a current enough SDK for your setup, install .NET manually instead.
First we need to update the APT package manager repositories and install dependencies.
@ -366,7 +372,7 @@ After you did it, we need to install dependencies for .NET, with the following c
apt install wget nano unzip libc6 libgcc1 libgssapi-krb5-2 libstdc++6 zlib1g libicu70 libssl3 -y
```
After you have installed dependencies, it's time to install .NET, you either can follow this tutorial or the [Microsoft one](https://docs.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#manual-install).
After you have installed the dependencies, install .NET either by following this guide or by using Microsoft's [manual install instructions](https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#manual-install).
Navigate to your `/root` home directory with the following command:
@ -374,27 +380,27 @@ Navigate to your `/root` home directory with the following command:
cd /root
```
First you need to download .NET 7.0, you can do it with the following command:
Download a current .NET SDK tarball for your platform from Microsoft. For example:
```bash
wget https://download.visualstudio.microsoft.com/download/pr/6cd2eaa7-4c06-4168-b90b-ee2d6bb40b10/4a8387eb07e17d262bfb9965f6d34462/dotnet-sdk-7.0.203-linux-arm64.tar.gz
wget <current-dotnet-sdk-linux-arm64-tarball-url>
```
<div class="custom-container tip"><p class="custom-container-title">Tip</p>
**This tutorial assumes that you have 64 bit version of ARM processor, if you happen to have a 32-bit version replace the link in the command above with [this one](https://download.visualstudio.microsoft.com/download/pr/55972ef4-146e-47e6-b014-0163cbaca6a3/fa9713f73f44088898843016d68c5929/dotnet-sdk-7.0.203-linux-arm.tar.gz)**
**This example assumes a 64-bit ARM processor. If you are using a different architecture, download the matching SDK archive for that platform instead.**
</div>
<div class="custom-container tip"><p class="custom-container-title">Tip</p>
**This tutorial assumes that you're following along and using Ubuntu 22.04, if you're using a different distro, like Alpine, go to [here](https://dotnet.microsoft.com/en-us/download/dotnet/7.0) and copy an appropriate link for your distro.**
**This tutorial assumes Ubuntu 22.04. If you are using a different distro, get the current SDK archive for your platform from the [.NET download page](https://dotnet.microsoft.com/en-us/download).**
</div>
Once the file has been downloaded, you need to run the following commands in order:
1. `DOTNET_FILE=dotnet-sdk-7.0.203-linux-arm64.tar.gz`
1. `DOTNET_FILE=<downloaded-dotnet-sdk-archive-name>`
<div class="custom-container warning"><p class="custom-container-title">Warning</p>
@ -537,7 +543,7 @@ Also, here are some linux tutorials for people who are new to it:
<div class="custom-container tip"><p class="custom-container-title">Tip</p>
**This is a new section, if you find a mistake, please report it by opening an Issue in our [Github repository](https://github.com/MCCTeam/Minecraft-Console-Client). Thank you!**
**This is a newer section. If you spot a mistake, please report it by opening an issue in our [GitHub repository](https://github.com/MCCTeam/Minecraft-Console-Client).**
</div>
@ -1057,10 +1063,10 @@ Remove the file, we do not need it anymore:
rm packages-microsoft-prod.deb
```
Finally, install .NET Core 7:
Finally, install the current .NET SDK:
```bash
sudo apt-get update -y && sudo apt-get install -y dotnet-sdk-7.0
sudo apt-get update -y && sudo apt-get install -y dotnet-sdk-10.0
```
Run the following command to check if everything was installed correctly:
@ -1087,11 +1093,11 @@ path-to-application:
If you do not get this output and the installation was not successful, [try other methods](https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#2204).
If it was successful, you can now install the MCC.
If it was successful, you can now install MCC.
### Installing MCC on a VPS
Now that you have .NET Core 7.0 and a user account, you should install the `screen` utility, you will need this in order to keep the MCC running once you close down the SSH session (if you do not have it, the MCC will just stop working once you disconnect). You can look at the `screen` like a window, except it's in a terminal, it lets you have multiple "windows" open at the same time.
Now that you have the .NET SDK and a user account, install the `screen` utility. You will need it if you want MCC to keep running after you close the SSH session.
<div class="custom-container tip"><p class="custom-container-title">Tip</p>

View file

@ -47,7 +47,7 @@ screen -S mcc
# Detach from the screen by pressing CTRL + A + D
# Re-attach if you want to have accces again
# Re-attach if you want access again
screen -r mcc
```
@ -59,7 +59,7 @@ See [Run using Docker](./installation.md#using-docker)
## Command-line usage
**Minecraft Console Client** has a plethora of useful command line parameters, here you can learn about them.
**Minecraft Console Client** has a number of useful command-line parameters. This section covers the most important ones.
### For people not familiar with the command line
@ -97,6 +97,8 @@ Here is an example for using a `--help` command line parameter for MCC that will
MinecraftClient.exe --help
```
MCC also supports a few maintenance and debugging switches such as `--upgrade`, `--force-upgrade`, `--generate`, `--keyboard-debug`, `BasicIO`, and `BasicIO-NoColor`.
### Quick usage of MCC with examples
<div class="custom-container tip"><p class="custom-container-title">Tip</p>
@ -119,16 +121,16 @@ Examples:
# Logging in as a user: notch, with a password: password123 onto a server with the ip: mc.someserver.com:25565
MinecraftClient.exe notch password123 mc.someserver.com:25565
# Overriding a setting from MinecraftClient.ini using a command line parameter
# Overriding a setting from MinecraftClient.ini using a command-line parameter
MinecraftClient.exe --debugmessages=false
# Providing a custom settings ini file and overriding a language to Chinese
# Providing a custom settings file and overriding the language to Chinese
MinecraftClient.exe CustomSettingsFile.ini --language=zh
```
### Rules of using the command line parameters
You can mix and match arguments by following theses rules:
You can mix and match arguments by following these rules:
- First positional argument may be either the login or a settings file
- Other positional arguments are read in order: login, password, server, command
@ -150,7 +152,7 @@ MinecraftClient.exe <login> <password> <server> "/mycommand"
```
- This will automatically send `/mycommand` to the server and close.
- To send several commands and/or stay connected, use the 1ScriptScheduler1 bot instead.
- To send several commands or stay connected, use the `ScriptScheduler` bot instead.
```bash
MinecraftClient.exe <myconfig.ini>
@ -247,7 +249,7 @@ In scripts and remote control, no slash is needed to perform the command, eg. `q
Reports the block type at the given position.
If you use the `-s` option it will report the types of blocks around the targeted blokcs.
If you use the `-s` option, it also reports the surrounding block types.
- **Usage:**
@ -558,11 +560,11 @@ In scripts and remote control, no slash is needed to perform the command, eg. `q
- **Description:**
Reloads settings from MinecraftClient.ini and Chat Bots.
Reloads the active configuration file and chat bots.
<div class="custom-container tip"><p class="custom-container-title">Tip</p>
**Some settings won't be reloaded since they are used before the client initialization. Also, settings provided by the command line paramteres will be overriden. This also does not reload the ReplayBot due to technical limitations.**
**Some settings are not reloaded because they are used before client initialization. Settings passed on the command line also override file values. ReplayCapture is not reloaded due to technical limitations.**
</div>
@ -800,7 +802,7 @@ In scripts and remote control, no slash is needed to perform the command, eg. `q
<div class="custom-container tip"><p class="custom-container-title">Tip</p>
**This command is avaliable only with [Follow Player](chat-bots.md#follow-player) Chat Bot enabled.**
**This command is available only when the [Follow Player](chat-bots.md#follow-player) chat bot is enabled.**
</div>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,142 +1,7 @@
# Web Socket Chat Bot documentation
# WebSocket Chat Bot
This is a documentation page on the Web Socket chat bot and on how to make a library that uses web socket to execute commands in the MCC and processes events sent by the MCC.
The in-tree WebSocket chat bot is not part of the current MCC codebase.
Please read the [Important things](#important-things) before everything.
These pages are kept only as historical placeholders because older documentation linked to them. Current mainline builds do not ship a `WebSocketBot`, and there is no supported WebSocket protocol to configure or rely on in the current project state.
# Page index
- [Important things](#important-things)
- [Prerequisites](#prerequisites)
- [Limitations](#limitations)
- [Precision of information](#precisionvalidity-of-the-information-in-this-guide)
- [How does it work?](#how-does-it-work)
- [Sending commands](#sending-commands-to-mcc)
- [Websocket Commands](Commands.md)
- [Websocket Events](Events.md)
- [Reference Implementation](#reference-implementation)
## Reference implementation
I have made a reference implementation in TypeScript/JavaScript, it is avaliable here:
[https://github.com/milutinke/MCC.js](https://github.com/milutinke/MCC.js)
It is great for better understanding how this works.
## Important things
### Prerequisites
This guide/documentation assumes that you have enough of programming knowledge to know:
- What Web Socket is
- Basics of networking and concurency
- What JSON is
- What are the various data types such as boolean, integer, long, float, double, object, dictionary/hash map
Without knowing those, I highly recommend learning about those concepts before trying to implement your own library.
### Limitations
The Web Socket chat bot should be considered experimental and prone to change, it has not been fully tested and might change, keep an eye on updates on our official Discord server.
### Precision/Validity of the information in this guide
This guide has been mostly generated from the code itself, so the types are C# types, except in few cases where I have manually changed them.
For some thing you will have to dig in to the MCC C# code of the Chat Bot and various helper classes.
**Some information sent by the MCC, for example entity metadata, block ids, item ids, or various other data is different for each Minecraft Version, thus you need to map it for each minecraft version.**
Some events might not be that useful, eg. `OnNetworkPacket`
## How does it work?
So, basically, this Web Socket Chat Bot is a chat bot that has a Web Socket server running while you're connected to a minecraft server.
It sends events, and listens for commands and responds to commands.
It has build in authentication, which requires you to send a command to authenticate if the the password is set, if it is not set, it should automatically authenticate you on the first command.
You also can name every connection (session) with an alias.
The flow of the protocol is the following:
```
Connect to the chat bot via web socket
|
|
\ /
`
Optionally set a session alias/name with "ChangeSessionId" command
(this can be done multiple times at any point)
|
|
\ /
`
Send an "Authenticate" command if there is a password set
|
|
\ /
`
Send commands and listen for events
```
In order to implement a library that communicates witht this chat bot, you need to make a way to send commands, remember the sent commands via the `requestId` value, and listen for `OnWsCommandResponse` event in which you need to detect if your command has been executed by looking for the `requestId` that matches the one you've sent. I also recommend you put a 5-10 seconds command execution timeout, where you discard the command if it has not been executed in the given timeout range.
## Sending commands to MCC
You can send text in the chat, execute client commands or execute remote procedures (WebSocket Chat Bot commands).
Each thing that is sent to the chat bot results in a response through the [`OnWsCommandResponse`](#onwscommandresponse) event.
### Sending chat messages
To send a chat message just send a plain text with your message to via the web socket.
### Executing client commands
To execute a client command, just send plain text with your command.
Example: `/move suth`
### Execution remote procedures (WebSocket Chat Bot commands)
In order to execute a remote procedure, you need to send a json encoded string in the following format:
```json
{
"command": "<command name here>",
"requestId": "<randomly generated string for identification>",
"parameters": [ 1, "some string", true, "etc.." ]
}
```
#### `command`
Refers to the name of the command
#### `requestId`
Is a unique indentifier you generate on each command, it will be returned in the response of the command execution ([`OnWsCommandResponse`](#onwscommandresponse)), use it to track if a command has been successfully executed or not, and to get the return value if it has been successfully executed. (*It's recommended to generate at least 7 characters to avoid collision, best to use an UUID format*).
#### `parameters`
Are parameters (attibutes) of the procedure you're executing, they're sent as an array of data of various types, the Web Socket chat bot does parsing and conversion and returns an error if you have sent a wrong type for the given parameters, of if you haven't send enough of them.
**Example:**
```json
{
"command": "Authenticate",
"requestId": "8w9u60-q39ik",
"parameters": ["wspass12345"]
}
```
If this feature returns in a future release, this section should be rewritten from the implementation instead of from the old archived docs.