Skip to content

Game info ​

lynx.game() returns read-only game state, the same on every Minecraft version.

Method
fps()Frames per second
inWorld()false on the title screen and while a world loads
x(), y(), z()Player position
yaw()Horizontal look direction in degrees (0 = south, 90 = west)
ping()Latency to the server in ms, -1 in singleplayer or when unknown
isDown(GameKey)Whether a movement or action key is held: FORWARD, BACK, LEFT, RIGHT, JUMP, SNEAK, SPRINT, ATTACK, USE
keyName(GameKey)Short name of the bound key ("W", "Space", "LMB")
armor(slot)Worn armour: 0 helmet, 1 chestplate, 2 leggings, 3 boots
mainHand(), offHand()Held items; the off hand is always empty on 1.8.9
hasOffHand()Whether this Minecraft version has an off hand (1.9+)
example(slot)A sample item for the HUD editor (0 to 3 armour, 4 main hand, 5 off hand)
effects()Active potion effects: name, level, remaining ticks, infinite

Items are ItemViews: isEmpty(), count(), damage(), maxDamage(), durabilityLeft(). Draw them with RenderContext.item(...).

Outside a world most values are zero or empty, so check inWorld() first.