Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/ancientlore/go-mcpi-api

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/ancientlore/go-mcpi-api

  • v1.0.3
  • Source
  • Go
  • Socket score

Version published
Created
Source

go-mcpi-api

GoDoc

This library enables you to use the Minecraft Pi Edition API from Go. Each connection uses a single socket and commands are sent over channels, making it safe to use the API from different goroutines.

中文版本README: 用go語言翻轉Minecraft - go-mcpi-api

Also see FrozenKP's version.

FAQ

What is MCPI ?

MCPI is an API which can let you control Minecraft with code.

It's original edition was written with python; you can learn it here.

Can I using it with a normal edition Minecraft ?

Yes, you can. You can refer to this project.

Example

var c mcpiapi.Connection
c.Open("192.168.1.115", "player1")
defer c.Close()

go func() { c.Chat().Post("Hello, World!") }()
go func() { c.Chat().Post("Hello again!") }()

err = c.World().SetBlock(0, 0, 0, mcpiapi.GOLD_BLOCK, 0)
if err != nil {
	log.Print(err)
}

Pocket Edition Information

Block types are 0-108. See the Minecraft Wiki for information on block values.

Block data is 0-15, and is used to specify extra characteristics like wool color.

Regarding the coordinate system, (0,0,0) is where the world was spawned and is sea level. (X,Z) represents the ground plane while Y points to the sky.

Be sure and read the Minecraft Pi Edition API speificication which is included in the installation at mcpi/api/spec/mcpi_protocol_spec.txt.

The library includes some utility functions for shapes - more may be added over time.

NOTE: Events have not been tested.

Installation

go get github.com/ancientlore/go-mcpi-api

FAQs

Package last updated on 04 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc