Skip to content

joodicator/mcchat2

Repository files navigation

mcchat2

A machine-usable Minecraft chat console client.

Contents

  1. Dependencies
  2. Installation and Usage
  3. Special Input Sequences
    1. ?query
    2. ?exit
    3. --auto-query
  4. Available Plugins
    1. mapimg

Dependencies

Required

Optional

  • mcmapimg (for the mapimg plugin; included as a Git submodule)
  • Git (to install from GitHub)

Installation and Usage

  1. Clone this repository into an empty directory:

    git clone https://github.com/joodicator/mcchat2
    cd mcchat2
    
  2. Initialise the submodules:

    git submodule update --init --recursive
    
  3. For information on the command-line arguments of mcchat2, see:

    ./mcchat2.py --help
    

Special Input Sequences

While running, each line from mcchat2's standard input is sent to the server (if connected) as one or more chat messages, unless it takes one of the following special forms:

?query NAME

Ask for the value of the property called NAME. The program responds by printing to standard output (possibly after a delay during which other unrelated messages may be printed) either

  • !query success NAME VALUE... or
  • !query failure NAME REASON...

If the same property is queried more than once, the program may respond by issuing only a single reply for several identical queries. The property NAME may be any of the following:

  • players - the names of all players on the server, separated by spaces. Only available when connected.
  • agent - the player name that mcchat2 appears as on the server. Only available when connected.
  • Any key from the key/value section of Minecraft's query interface. Only available when the server's UDP query interface is enabled.

?exit [--quiet] [--code=N] [REASON...]

Cause the program to exit, disconnecting first from the server if necessary. If a REASON is given, this printed to standard output or standard error; otherwise, it defaults to Manually closed.

If the --quiet flag is present and the program is currently disconnected from the server in standby mode, the exit reason is printed to standard error rather than standard output. This can be useful in combination with the --quiet-start command-line flag of mcchat2 to restart the client without causing unnecessary noise.

If --code=N is given, then N is used as the exit status code of the program; otherwise, it defaults to 0.

--auto-query

If this command-line option is present, then, when starting and whenever successfully connecting to the server after having previously been disconnected, mcchat2 automatically acts as if ?query map were issued; and, when successfully connecting to the server, mcchat2 acts as if ?query agent were issued. This allows a program listening to mcchat2's standard output to stay up to date with the values of these properties without knowing the internal state of mcchat2.

Available Plugins

mapimg

When mcchat2 is run with this plugin loaded, e.g. with --plugins mapimg in its command-line arguments, then any maps encountered by the client are saved as two image files in plugins/mapimg/maps:

  1. map_NUMBER.png - the main map image without any icons.
  2. map_NUMBER_icons.png - an otherwise transparent image containing any map icons.

About

A machine-usable Minecraft chat console client.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages