Objectpi.Minecraft
public class Minecraft
The main class to interact with a running instance of Minecraft Pi.
Example:
Minecraft.connect().setBlock(0, 2, 0, Block.GOLD_ORE)
Nested Class Summary | |
---|---|
class |
Minecraft.Camera
Control the camera in the game we're connected to |
class |
Minecraft.Entities
Methods for entities |
class |
Minecraft.Events
Events |
class |
Minecraft.Player
Methods for the player in the connected game |
Field Summary | |
---|---|
Minecraft.Camera |
camera
|
Minecraft.Entities |
entities
|
Minecraft.Events |
events
|
Minecraft.Player |
player
|
Tools |
tools
|
Method Summary | |
---|---|
void |
autoFlush(boolean auto)
If auto is false, commands are kept in a buffer until they are flushed with flush() or the buffer fills up. Default is to automatically flush each command separately. |
static Minecraft |
connect()
Connect to a local mcpi game |
static Minecraft |
connect(String host)
Connect to a remote mcpi game |
static Minecraft |
connect(String[] args)
Connect with string args |
protected void |
finalize()
|
void |
flush()
Flush commands that are buffered, not needed, unless autoFlush(false). |
Block |
getBlock(Vec position)
Get a block |
Block |
getBlockWithData(Vec position)
Get a block |
int |
getHeight(int x,
int z)
Get the height of the world (last Y that isn't solid from top-down) |
int[] |
getPlayerEntityIds()
Get the entity ids of the connected players |
void |
postToChat(String message)
Post a message to the game chat |
void |
restoreCheckpoint()
Restore the world state to the checkpoint |
void |
saveCheckpoint()
Save a checkpoint that can be used for restoring the world |
void |
setBlock(int x,
int y,
int z,
Block block)
Set a block |
void |
setBlock(Vec position,
Block block)
Set a block |
void |
setBlocks(int x1,
int y1,
int z1,
int x2,
int y2,
int z2,
Block block)
Set a cuboid of blocks |
void |
setBlocks(Vec begin,
Vec end,
Block block)
Set a cuboid of blocks |
void |
setting(String key,
boolean value)
Keys: "world_immutable", "nametags_visible" |
Methods inherited from class Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final Minecraft.Camera camera
public final Minecraft.Player player
public final Minecraft.Entities entities
public final Minecraft.Events events
public final Tools tools
Method Detail |
---|
public static Minecraft connect()
public static Minecraft connect(String host)
public static Minecraft connect(String[] args)
args
- an array with optional host, portpublic Block getBlock(Vec position)
public Block getBlockWithData(Vec position)
public void setBlock(int x, int y, int z, Block block)
public void setBlock(Vec position, Block block)
public void setBlocks(int x1, int y1, int z1, int x2, int y2, int z2, Block block)
public void setBlocks(Vec begin, Vec end, Block block)
public int getHeight(int x, int z)
public int[] getPlayerEntityIds()
public void setting(String key, boolean value)
public void saveCheckpoint()
public void restoreCheckpoint()
public void postToChat(String message)
public void autoFlush(boolean auto)
public void flush()
protected void finalize() throws Throwable
finalize
in class Object
Throwable