MyNixOS website logo
Description

Connect to MineCraft running on a Raspberry PI.

The MineCraft edition for Raspberry PI comes with a Java and Python API. See Network.MineCraft.Pi.Client for a basic example.

This is a *very* basic, and *incomplete* Haskell version. I fully expect everything to change in later versions.

A number of very simple examples are included in the examples/ directory, as well as a program that lets you interact with MineCraft directly.

Please see the TODO.md file in the source code for an incomplete list of possible changes, and the CHANGELOG file for changes in the module.

Example programs

There are several programs, illustrating some very basic interactions with MineCraft-PI.

When called with the --debug argument the programs will print, to stderr, the messages they send to, and receive from, the MineCraft program.

These programs are built by setting the build-examples flag, which is set by default, so either of the following will work

cabal configure
cabal configure -fbuild-examples

To avoid building the programs, use:

cabal configure -f-build-examples

freefall

Source code: Freefall.hs

Usage:

freefall [--debug] [jump]

Increase the height of the player by jump blocks. If not specified the jump is 100 blocks. A check is made to ensure that the jump does not place the player into a block. Messages are sent to MineCraft to inform the player what is happening.

There is no check that jump is valid (e.g. is positive, or not so great that it exceeds the limits of the world), but this could be added quite easily.

flatten

Source code: Flatten.hs

Usage:

flatten [--debug] [radius]

Flatten the area surrounding the user, converting the floor into gold and removing any blocks above it. The area converted is a circle of the given radius (this defaults to 5 if not given). The central tile is not counted, so that a radius of 1 will change the blocks in front of, behind, and to the side of the player.

There is no check that the blocks that are added are actually supported, although this could be added by an enterprising programmer.

isongold

Source code: IsOnGold.hs

Usage:

isongold [--debug]

Tells the user to look down if they are standing on a gold ore block.

xjump

Source code: XJump.hs

Usage:

xjump [--debug]

Move the player by 10 tiles in the X direction if the tile is not filled.

Debug programs

The following are useful when trying to debug the module.

These programs are built by setting the build-debug flag, which is not set by default:

cabal configure -fbuild-debug

hmcpi

Source code: HMCPI.hs

Usage:

hmcpi
hmcpi < filename

This provides a direct interface to MineCraft-PI. You enter the full commands, such as chat.post(Hello World!) or world.getBlock(0,0,0), and see the response from the game. The program is essentially telnet but specialized to only talk to MineCraft. There is currently no attempt at providing a nicer interface, such as help, automatic completion of commands, or cleaning user input.

Note that this program does not take use the mcpi library, since it is provides a direct connection to the MineCraft-Pi program.

debugmcpi

Source code: DebugMCPI.hs

Usage:

debugmcpi

This provides a simple interface for sending commands and queries to MineCraft. It differs from hmcpi in that you do not talk directly to MineCraft, instead you have the following commands

exit quit command name [arg1 .. argn] query name [arg1 .. argn]

Everything is treated as a string.

Metadata

Version

0.0.1.2

License

publicDomain

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows