Documentation ¶
Overview ¶
package mctools holds a collection of tools used to read, edit and write Minecraft world data. Refer to the respective sub-packages for details on their purpose.
The code targets Minecraft 1.8+. Older worlds may work or they may not. Use at your own risk.
Warning ¶
The code defines read->write->read roundtrip tests to ensure the written data is consistent and correct. Even so, you should __always create backups__ of any world you are about to change. I am __not__ responsible for any damage you may do to your world data or Minecraft itself.
This package has been tested with world data created in Vanilla Minecraft 1.8.3+. There are no guarantees that older worlds can be read or that changes to such a world will still load up in Minecraft. Test your changes thoroughly. And when you're done testing, test some more.
Additionally, don't read/write world data which is currently being used by Minecraft itself. The behaviour of this undefined and will very likely end up in tears.
Index ¶
Constants ¶
const ( DimensionOverworld = "region" DimensionNether = "DIM-1/region" DimensionEnd = "DIM1/region" )
Known dimension names.
Variables ¶
This section is empty.
Functions ¶
func BlockCoords ¶
BlockCoords returns block offsets in a chunk for the given, absolute block position.
func ChunkCoords ¶
ChunkCoords returns the chunk coordinates for the given, absolute block position.
func RegionCoords ¶
RegionCoords returns region coordinates from the given, absolute block position.
Types ¶
type World ¶
World defines a single Minecraft world.
func (*World) CreateRegion ¶
CreateRegion creates a new region in this world and specified dimension, using the given coordinates. Returns an error if the region already exists.
func (*World) DeleteRegion ¶
DeleteRegion deletes the given region.
If you have an open handle to this region, close it before calling this, as accessing its data afterwards will have undefined behaviour.
Note that this permanently deletes the region file from disk. This operation can not be undone.
func (*World) LoadRegion ¶
LoadRegion loads the given region in the specified dimension. Returns nil if the region could not be loaded.
Directories ¶
Path | Synopsis |
---|---|
Package anvil reads level.dat and .mca region files which make up Minecraft worlds.
|
Package anvil reads level.dat and .mca region files which make up Minecraft worlds. |
biome
Package biome describes a set of known biomes.
|
Package biome describes a set of known biomes. |
item
Package item defines constants with ids for all known items.
|
Package item defines constants with ids for all known items. |
nbt
NBT (Named Binary Tag) is a tag based binary format designed to carry large amounts of binary data with smaller amounts of meta data.
|
NBT (Named Binary Tag) is a tag based binary format designed to carry large amounts of binary data with smaller amounts of meta data. |
Package mcra defines an API to query Minecraft world data.
|
Package mcra defines an API to query Minecraft world data. |
recipe
Package recipe defines an interface and listing of all known Minecraft recipes and facilities to create recipe trees.
|
Package recipe defines an interface and listing of all known Minecraft recipes and facilities to create recipe trees. |