Minecraft
The Minecraft object (mc) is only provided to events.
Type | Name | Description | Signature |
---|---|---|---|
field | thePlayer | Player Object | |
field | theWorld | World Object | |
field | fontRendererObj | Main Font Renderer | |
field | timer | Game Timer | |
field | debug | Debug information | string |
field | displayWidth | Window Width * Scale factor | decimal |
field | displayHeight | Window Height * Scale factor | decimal |
field | leftClickCounter | Mouse left click counter | int |
field | rightClickDelayTimer | Mouse right click delay, decreases each tick | int |
function | getDebugFPS | Returns FPS displayed in F3 | int |
function | getFramebuffer | Returns the root framebuffer | |
function | isSingleplayer | Whether the User is playing on Singleplayer | boolean |
function | getCurrentServerData | Returns current ServerData, if not connected to a server - null |
Framebuffer
Type | Name | Description | Signature |
---|---|---|---|
field | framebufferTextureWidth | Bound texture width | int |
field | framebufferTextureHeight | Bound texture height | int |
field | framebufferWidth | Framebuffer width | int |
field | framebufferHeight | Framebuffer height | int |
field | useDepth | Use depth | boolean |
field | framebufferObject | Framebuffer object id | int |
field | framebufferTexture | Bound texture id | int |
field | depthBuffer | Render buffer for depth | int |
field | framebufferColor | Hex color for framebuffer | float[] |
field | framebufferFilter | Framebuffer filter | int |
function | createBindFramebuffer | Creates and binds the framebuffer (args: width, height) | void(int, int) |
function | deleteFramebuffer | Deletes and unbinds the framebuffer | void |
function | createFramebuffer | Creates the framebuffer | void(int, int) |
function | setFramebufferFilter | Sets the framebuffer texture filter | void(int) |
function | checkFramebufferComplete | Checks framebuffer status via | void() |
function | bindFramebufferTexture | Binds the framebuffer texture | void() |
function | unbindFramebufferTexture | Unbinds the framebuffer texture | void() |
function | bindFramebuffer | Binds the framebuffer (args: viewport - sets the viewport to framebuffer width and height) | void(boolean) |
function | unbindFramebuffer | Unbinds the framebuffer | void() |
function | setFramebufferColor | Sets the framebuffer color (args: r, g, b, a - in range of 0.0 to 1.0) | void(float, float, float, float) |
function | framebufferRender | Renders the framebuffer on the screen (args: width, height) | void(int, int) |
function | framebufferRenderExt | Renders the framebuffer on the screen, optionally disables blend (args: width, height, disableBlend) | void(int, int, boolean) |
function | framebufferClear | Clears the color and unbinds the framebuffer | void() |
Instantiation
You can create a Framebuffer object by invoking the global Framebuffer
function: new Framebuffer(displayWidth, displayHeight, useDepth)
ServerData
Type | Name | Description | Signature |
---|---|---|---|
field | serverIP | Connected Server IP | string |
field | serverName | Connected Server Name | string |
field | serverMOTD | Connected Server MOTD | string |
field | pingToServer | Ping to the connected server | long |
field | populationInfo | Populated slots/total info | string |
field | version | Protocol version | int |
field | gameVersion | Game version for this server | string |
field | playerList | Players separated by newlines | string |
field | lanServer | Whether this server is hosted locally | boolean |
FontRenderer
Type | Name | Description | Signature |
---|---|---|---|
function | drawString | Draws a string on the screen (args: text, x, y, color) | void(string, int, int, int) |
function | drawStringWithShadow | Draws a string on the screen with a shadow (args: text, x, y, color) | void(string, float, float, int) |
function | getStringWidth | Returns the string's width | int(string) |
function | listFormattedStringToWidth | Returns wrapped strings to width as a list (args: text, wrapWidth) | List<String>(string, int) |
function | trimStringToWidth | Trims a string to some width (args: string, width) | string(string, int) |
function | trimStringToWidthReverse | Trims a string to some width, from right to left (args: string, width) | string(string, int) |
function | getCharWidth | Returns a char's width | int(char) |
function | getColorCode | Returns the color of a char. Used when parsing the string for Minecraft color codes. | int(char) |
function | getUnicodeFlag | Whether the Force Unicode Font option is enabled. | boolean() |
WorldClient
Type | Name | Description | Signature |
---|---|---|---|
function | getBlockState | Returns the block state of a block in the world. Default state if the position is invalid. | IBlockState(BlockPos) |
function | getLoadedEntityList | Returns the visible entity list. | List<Entity>() |
Timer
Controls the speed of the game.
Type | Name | Description | Signature |
---|---|---|---|
function | updateTimer | Updates the game timer | void() |
field | timerSpeed | Game speed | float |
field | renderPartialTicks | Time elapsed since the last tick, used for rendering, and is frozen | float |
field | elapsedPartialTicks | Time elapsed since the last tick | float |
field | elapsedTicks | Ticks elapsed since the last timer update | float |
Vec3
3-dimensional Decimal vector.
Type | Name | Description | Signature |
---|---|---|---|
field | xCoord | X Coordinate of the Vector | double, immutable |
field | yCoord | Y Coordinate of the Vector | double, immutable |
field | zCoord | Z Coordinate of the Vector | double, immutable |
function | add | Adds two Vectors together | Vec3(Vec3) |
function | addVector | Adds X/Y/Z coordinates to the Vector | Vec3(double, double, double) |
function | subtract | Subtract a Vector from this Vector | Vec3(Vec3) |
function | subtractVector | Subtract X/Y/Z coordinates from this Vector | Vec3(double, double, double) |
function | rotateYaw | Rotate Vector around yaw | Vec3(float) |
function | rotatePitch | Rotate Vector around pitch | Vec3(float) |
function | crossProduct | Returns a cross product of another vector and this vector | Vec3(Vec3) |
function | dotProduct | Returns a dot product of another vector and this vector | double(Vec3) |
function | distanceTo | Returns distance to another vector | double(Vec3) |
function | lengthVector | Returns the length of this vector | double() |
function | normalize | Normalizes this vector | Vec3() |
Instantiation
You can create a Vec3 object by invoking the global Vec3
function: new Vec3(1.0, 2.0, 3.0)
Vec3i
3-dimensional Integer vector.
Type | Name | Description | Signature |
---|---|---|---|
function | getX | Returns the X Coordinate of the Vector | double() |
function | getY | Returns the Y Coordinate of the Vector | double() |
function | getZ | Returns the Z Coordinate of the Vector | double() |
function | crossProduct | Returns a cross product of another vector and this vector | Vec3i(Vec3i) |
function | compareTo | Compares this vector to another vector | int(Vec3i) |
function | distanceSq | Returns squared distance to another vector | double(Vec3i) |
Instantiation
You can create a Vec3i object by invoking the global Vec3i
function: new Vec3i(1, 2, 3)
Inherits
BlockPos
Type | Name | Description | Signature |
---|---|---|---|
function | offset | Offsets this BlockPos n blocks in the given direction | BlockPos(EnumFacing, int) |
function | add | Adds the vector to this BlockPos | BlockPos(Vec3i) |
function | subtract | Subtracts the vector from this BlockPos | BlockPos(Vec3i) |
function | toLong | Serializes the coordinates to a long value | long() |
You can create a BlockPos object by invoking the global BlockPos
function: new BlockPos(1, 2, 3)
ScaledResolution
Window resolution with a scale factor.
Type | Name | Description | Signature |
---|---|---|---|
function | getScaleFactor | Returns the scale factor | int() |
function | getScaledWidth | Returns the scaled window width | int() |
function | getScaledHeight | Returns the scaled window height | int() |
function | getScaledWidth_double | Returns the scaled window width | double() |
function | getScaledHeight_double | Returns the scaled window height | double() |
Instantiation
You can create a ScaledResolution object by invoking the global ScaledResolution
function: new ScaledResolution(mc)
AxisAlignedBB
Represents an axis-aligned bounding box.
Type | Name | Description | Signature |
---|---|---|---|
field | minX | Minimum X point | double, immutable |
field | minY | Minimum Y point | double, immutable |
field | minZ | Minimum Z point | double, immutable |
field | maxX | Maximum X point | double, immutable |
field | maxY | Maximum Y point | double, immutable |
field | maxZ | Maximum Z point | double, immutable |
function | addCoord | Add X/Y/Z coordinates to the AABB | AxisAlignedBB(double, double, double) |
function | offset | Offset an AABB by X/Y/Z coordinates | AxisAlignedBB(double, double, double) |
function | expand | Expand an AABB by X/Y/Z coordinates | AxisAlignedBB(double, double, double) |
function | contract | Inset an AABB by X/Y/Z coordinates | AxisAlignedBB(double, double, double) |
function | calculateIntercept | Calculate interception of two vector | MovingObjectPosition(Vec3, Vec3) |
function | calculateXOffset | Calculate the offset between two boxes in the X dimension | double(AxisAlignedBB, double) |
function | calculateYOffset | Calculate the offset between two boxes in the Y dimension | double(AxisAlignedBB, double) |
function | calculateZOffset | Calculate the offset between two boxes in the Z dimension | double(AxisAlignedBB, double) |
function | intersectsWith | Whether the given AABB intersects with this AABB | boolean(AxisAlignedBB) |
function | isVecInside | Whether a Vec3 is inside this AABB | boolean(Vec3) |
function | union | Union with another AABB (use min/max coords of this and another) | AxisAlignedBB(AxisAlignedBB) |
Instantiation
You can create an AxisAlignedBB object by using the global AxisAlignedBB
function: new AxisAlignedBB(new BlockPos(0, 1, 0), new BlockPos(1, 2, 1))
. First BlockPos represents the min X/Y/Z coordinates, second - maximum.
MovingObjectPosition
Represents object being ray traced.
Type | Name | Description | Signature |
---|---|---|---|
field | entityHit | Raytraced Entity, present if type of hit is entity | Entity, nullable |
field | hitVec | Raytrace Hit vector | Vec3, nullable |
field | sideHit | Raytrace Side of hit | EnumFacing, nullable |
function | getBlockPos | Raytraced BlockPos, present if type of hit is block | |
field | typeOfHit | Raytrace result, one of: miss, block, entity | string |
PacketBuffer
This object is a wrapper around the Netty's ByteBuf, used to easily pack game objects. Currently, only a part of the ByteBuf methods are provided dynamically, with no own members.
Instantiation
You can create a PacketBuffer object by using the global PacketBuffer function: new PacketBuffer(io.netty.buffer.Unpooled.buffer())
EnumFacing
Represents block facings.
Type | Name | Description | Signature |
---|---|---|---|
function | getIndex | Returns the Facing's index | int() |
function | getName | Returns the Facing's name | string() |
function | getHorizontalIndex | Returns the Facing's horizontal index | int() |
function | getFrontOffsetX | Returns X front offset, if the Facing is of X axis, otherwise 0 | int() |
function | getFrontOffsetZ | Returns Z front offset, if the Facing is of Z axis, otherwise 0 | int() |
function | getAxis | Returns Facing's axis | Axis() |
function | getAxisDirection | Returns Facing's axis direction | AxisDirection() |
function | getOpposite | Returns the opposite Facing | EnumFacing() |
function | rotateY | Returns clockwise rotated Facing by Y, clockwise | EnumFacing() |
function | rotateYCCW | Returns counterclockwise rotated Facing by Y | EnumFacing() |
function | rotateAround | Returns a rotated clockwise Facing around the given axis | EnumFacing(Axis) |
Can be obtained by referencing values in the EnumFacing
global variable. Acceptable values:
UP
DOWN
NORTH
SOUTH
EAST
WEST
Axis
Represents EnumFacing's Axis (x/y/z)
Type | Name | Description | Signature |
---|---|---|---|
function | apply | Checks if the Facing's Axis is the same as this Axis | boolean(EnumFacing) |
function | getPlane | Returns Axis' Plane | Plane() |
function | getName | Returns Axis' Name | string() |
function | isHorizontal | Whether this Axis is horizontal | boolean() |
function | isVertical | Whether this Axis is vertical | boolean() |
AxisDirection
Represents EnumFacing's Axis Direction (Towards positive/negative)
Type | Name | Description | Signature |
---|---|---|---|
function | getOffset | Returns direction's offset (-1/1) | int() |
function | name | Returns direction offset's name | string() |
Plane
Represents Axis' plane (horizontal/vertical)
Type | Name | Description | Signature |
---|---|---|---|
function | facings | Returns EnumFacings on this plane | EnumFacing[] |
function | name | Returns the Plane's name | string() |
function | apply | Returns true if the EnumFacing's Plane matches with this Plane | boolean(EnumFacing) |
ItemStack
Represents an Item stack.
Type | Name | Description | Signature |
---|---|---|---|
function | getDisplayName | Returns the item's display name | string() |
function | getUnlocalizedName | Returns the item's unlocalized name | string() |
IBlockState
Represents the Block and its properties.
Type | Name | Description | Signature |
---|---|---|---|
function | getBlock | Returns the state's Block | Block() |
Block
Represents a registered game Block.
Type | Name | Description | Signature |
---|---|---|---|
function | getLocalizedName | Returns the block's localized name | string() |
function | getUnlocalizedName | Returns the block's unlocalized name | string() |
IChatComponent
Represents a Chat object.
Type | Name | Description | Signature |
---|---|---|---|
function | getFormattedText | Returns the text of the component with color codes | string() |
function | getUnformattedText | Returns the text of the component and all its siblings, with color codes stripped | string() |
Last updated