# Usage How to run the program: - [Running on Windows](#windows) - [Running on Linux, macOS](#linux-macos) - [Running using Docker](#docker) Using the command line parameters: - [Examples](#quick-usage-of-mcc-with-examples) - [Command line parameters](#command-line-parameters) - [Internal commands](#internal-commands) ## Windows Simply run `MinecraftClient.exe` > **ℹ️ NOTE: On Windows it's best using [Windows Terminal](https://docs.microsoft.com/en-us/windows/terminal/install) for the best experience and looks. Some features like emojis in the [`/chunk`](#chunk) command do not work in CMD or Powershell 5** ## Linux, macOS To run the client you need to type the following command in your terminal emulator: ```bash ./MinecraftClient ``` If you want to keep it running in the background you can use `screen` (Linux only) Example: ```bash # Start the screen screen -S mcc # Run it ./MinecraftClient # Detach from the screen by pressing CTRL + A + D # Re-attach if you want to have accces again screen -r mcc ``` _Learn more on how to use the screen command: [YouTube](https://www.youtube.com/watch?v=_ZJiEX4rmN4)_ ## Docker See [Run using Docker](./guide/installation.md#using-docker) ## Command-line usage **Minecraft Console Client** has a plethora of useful command line parameters, here you can learn about them. ### For people not familiar with the command line For people who are not familiar with the usage of programs in the command line (terminal emulators), here we will explain what every single thing means, if you're already experienced you can skip this. In command line (terminal emulators) you can run programs by specifying their name and hitting enter, usually programs have additional way of being configured, started or provided some additional data in a different manner, this is achieved by using command line parameters. Command line parameters are written after the name of the program, they're separated by spaces and they can have a few different formats, examples: - `someparameter` - `-some-parameter` - `--some-other-parameter` - `--some-setting="some value"` - `-a=5` Parameters with a single dash (`-`) are usually used for a single letter (short-hand) parameters, while the ones with a double dash (`--`) are being used for parameters with a longer/full name. When you are reading examples, you will often see something like this: ``, this means that this is a place holder and it should be changed with some value, excluding the `<` and the `>`. For example `` you need to change to an username of your liking, example: `notch` (`<` and `>` should not be included). `[` and `]` mean that a parameter is an optional one. They also can hold some values, example from the MCC: ```bash MinecraftClient.exe --debugmessages=false ``` When a parameter has a textual value that includes one more spaces, you will need to wrap it the value in double quotes (`"`), example: `--some-parameter="some text here with spaces in it"` Here is an example for using a `--help` command line parameter for MCC that will print out a page on how to use MCC from the command line: ```bash MinecraftClient.exe --help ``` ### Quick usage of MCC with examples > **ℹ️ NOTE: On Linux and macOS, you need to type: `./MinecraftClient` instead of `MinecraftClient.exe`** ```bash MinecraftClient.exe --help MinecraftClient.exe MinecraftClient.exe "/mycommand" MinecraftClient.exe --setting=value [--other settings] MinecraftClient.exe --section.setting=value [--other settings] MinecraftClient.exe [--other settings] ``` Examples: ```bash # 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 MinecraftClient.exe --debugmessages=false # Providing a custom settings ini file and overriding a 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: - First positional argument may be either the login or a settings file - Other positional arguments are read in order: login, password, server, command - Arguments starting with `--` can be in any order and position Examples and further explanations: ```bash MinecraftClient.exe ``` - This will automatically connect you to the chosen server. - You may omit password and/or server to specify e.g. only the login - To specify a server but ask password interactively, use `""` as password. - To specify offline mode with no password, use `-` as password. ```bash MinecraftClient.exe "/mycommand" ``` - This will automatically send `/mycommand` to the server and close. - To send several commands and/or stay connected, use the 1ScriptScheduler1 bot instead. ```bash MinecraftClient.exe ``` - This will load the specified configuration file - If the file contains login / password / server ip, it will automatically connect. ```bash MinecraftClient.exe --setting=value [--other settings] ``` - Specify settings on the command-line, see possible value in the configuration file - Use `--section.setting=value` for settings outside the `[Main]` section - Example: `--antiafk.enabled=true` for enabling the `AntiAFK` bot ```bash MinecraftClient.exe [--other settings] ``` - Load the specified configuration file and override some settings from the file ## Internal Commands These commands can be performed from the chat prompt, scripts or remote control. From chat prompt, commands must by default be prepended with a slash, eg. `/quit`. In scripts and remote control, no slash is needed to perform the command, eg. `quit`. > **ℹ️ NOTE: Some commands may not be documented yet or are defined in description of Chat Bots, use `/help` to list them all, or you can contribute to this page.** ### `animation` - **Description:** Swing your main or off hand. - **Usage:** ``` /animation ``` ### `bed` - **Description:** Allows you to make the bot sleep easily, all about sleeping in one command. - **Usage:** Basic usage: `bed leave|sleep |sleep ` - **Examples:** Leave a bed: ``` /bed leave ``` Sleep in a bed on 124 84 76: ``` /bed sleep 124 84 76 ``` Sleep in a bed using relative coordinates: ``` /bed sleep ~ ~ ~-2 ``` Automatically find a bed in radius of 50 blocks and sleep in it: ``` /bed sleep 50 ``` ### `bots` - **Description:** Allows you to list and unload a specific bot or all bots. Useful when debugging and developing scripts. - **Usage:** ``` /bots > ``` - **Examples:** Unload a bot called CustomScript ``` /bots unload CustomScript ``` Unload all bots ``` /bots unload all ``` ### `changeslot` - **Description:** Change your selected slot in the hotbar. > **ℹ️ NOTE: You need to have [Inventory Handling](configuration.md#inventoryhandling) enabled in order for this to work.** - **Usage:** ``` /changeslot <1-9> ``` ### `chunk` - **Description:** Displays the chunk loading status in a nice way. > **⚠️ WARNING: To use this feature you need to enable the [Terrain and Movements](configuration.md#terrainandmovements)** > **ℹ️ NOTE: You need a terminal with emoji support, like Powershell 7, Windows Terminal or Alacritty, if you do not want emoji support and want to use cmd or powershell 5, disable emojis with: [`enableemoji`](configuration.md#enableemoji)** - **Usage:** ``` /chunk status [chunkX chunkZ|locationX locationY locationZ] ``` How it looks: ![Chunk status](http://i.pics.rs/DDB9W.png) ### `dig` - **Description:** Dig a block on a specific coordinate. - **Usage:** ``` /dig ``` - **Example:** ``` /dig 127 63 12 ``` Using relative coordinates: ``` /dig ~ ~-1 ~2 ``` ### `dropitem` - **Description:** Drop all items of a specific type from your inventory. > **ℹ️ NOTE: You need to have [Inventory Handling](configuration.md#inventoryhandling) enabled in order for this to work.** - **Usage:** ``` /dropitem ``` > **ℹ️ NOTE: All item types can be found [here](https://github.com/MCCTeam/Minecraft-Console-Client/blob/master/MinecraftClient/Inventory/ItemType.cs).** - **Example:** ``` /dropitem diamond ``` ### `entity` - **Description:** Attack an entity, use an entity or get a list of entities around you. > **ℹ️ NOTE: You need to have [Inventory Handling](configuration.md#inventoryhandling) and [Entity Handling](configuration.md#entityhandling) enabled in order for this to work.** - **Usage:** Basic usage: ``` /entity ``` Get a list of entities around you: ``` /entity ``` > **ℹ️ NOTE: All entity types can be found [here](https://github.com/MCCTeam/Minecraft-Console-Client/blob/master/MinecraftClient/Mapping/EntityType.cs).** - **Examples:** Attack a Zombie: ``` /entity Zombie attack ``` ### `execif` - **Description:** Allows you to execute a command if a specific condition is met. The condition is a C# expression and the local variables you set using [`set`](#set), [`setrnd`](#setrnd) or the configuration file can be used. The condition is always returned as a boolean, so only comparison can be done, if needed cast the expression result to bool. Also the instance of MCC is available with `MCC.`. > **ℹ️ NOTE: All local variables are treated as strings in the app, when comparing their values, you can use ` == ""`, or better use [`.Equals`](https://www.programiz.com/csharp-programming/library/string/equals) method** - **Usage:** Basic usage: `/execif ---> ` - **Examples:** Setting a variable and using it: ``` /set test=Something /execif test == "Something" ---> send Success! ``` ``` /set test2=1 /execif test2 == "1" ---> send Success 2! ``` Basic C# expression: ``` /execif 1 + 2 + 3 == 6 ---> send Success! ``` Using MCC class: ``` /execif MCC.GetHealth() == 20.0 ---> send Success! ``` Using in combination with [`execmulti`](#execmulti): ``` /execif 1 == 1 ---> execmulti send 1 -> send 2 -> send 3 ``` ### `execmulti` - **Description:** Allows you to execute multiple commands in succession on a single line, useful for debugging or when using [`execif`](#execif) Commands are separated by `->` - **Usage:** Basic usage: `execmulti -> -> -> ...` - **Examples:** ``` /execmulti send 1 -> send 2 -> send 3 -> sneak ``` ### `quit` - **Alias:** `exit` - **Description:** Disconnect from the server and close the application ### `reco` - **Description:** Disconnect and reconnect to the server - **Usage:** ``` /reco [account] ``` > **ℹ️ NOTE: `[account]` is an account alias defined in accounts file, for more info check out [accountlist](configuration.html#accountlist)** ### `reload` - **Description:** Reloads settings from MinecraftClient.ini and Chat Bots. > **ℹ️ NOTE: 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.** - **Usage:** ``` /reload ``` ### `connect` - **Description:** Go to the given server and resume the script - **Usage:** ``` /connect [account] ``` > **ℹ️ NOTE: `` is either a server IP or a server alias defined in servers file, for more info check out [serverlist](configuration.html#serverlist)** > **ℹ️ NOTE: `[account]` is an account alias defined in accounts file, for more info check out [accountlist](configuration.html#accountlist)** ### `script` - **Description:** Run a script containing a list of commands - **Usage:** ``` /script