Update from Crowdin

This commit is contained in:
BruceChen 2022-11-04 13:26:15 +08:00 committed by GitHub
parent e6849ae91a
commit 27c40f27d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
190 changed files with 16264 additions and 4806 deletions

View file

@ -8,7 +8,9 @@
## Notes
> ** NOTE: 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.**
::: tip
**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.**
:::
**Minecraft Console Client** has a rich C# API which allows you to create Chat Bots (effectively plugins) which can help you create complex automations which normal scripts may not be able to do.
@ -32,7 +34,9 @@ More in-depth:
This introduction assumes that you have the basic knowledge of C#.
> ** NOTE: Here we will use terms Chat Bot and Script interchangeably**
::: tip
**Here we will use terms Chat Bot and Script interchangeably**
:::
Create a new empty file and name it `ExampleChatBot.cs` in the same folder where you have your MCC installed.
@ -109,7 +113,9 @@ MCC.LoadBot(new YourChatBotClassNameHere());
**Script Metadata** section allows for including C# packages and libraries with: `//using <namespace>` and `/dll <dll name>`.
> ** NOTE: Avoid adding whitespace between `//` and keywords**
::: tip
**Avoid adding whitespace between `//` and keywords**
:::
By the default the following packages are loaded:
@ -155,7 +161,8 @@ 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. In it you can initialize variables, eg. Dictionaries, etc..
> ** NOTE: For allocating resources like a database connection, we recommend allocating them in `AfterGameJoined` and freeing them in `OnDisconnect`**.
::: tip
**For allocating resources like a database connection, we recommend allocating them in `AfterGameJoined` and freeing them in `OnDisconnect`** :::.
## Examples