public class Minecraft
extends Object
Minecraft.connect().setBlock(Vec.xyz(0, 2, 0), Block.GOLD_ORE)
Modifier and Type | Class and Description |
---|---|
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
|
Modifier and Type | Field and Description |
---|---|
Minecraft.Camera |
camera |
Minecraft.Entities |
entities |
Minecraft.Events |
events |
Minecraft.Player |
player |
Tools |
tools |
Modifier and Type | Method and Description |
---|---|
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
|
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"
|
public final Minecraft.Camera camera
public final Minecraft.Player player
public final Minecraft.Entities entities
public final Minecraft.Events events
public final Tools tools
public static Minecraft connect()
public static Minecraft connect(String host)
public static Minecraft connect(String[] args)
args
- an array with optional host, portpublic void setBlock(int x, int y, int z, Block block)
public void setBlocks(int x1, int y1, int z1, int x2, int y2, int z2, 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