Interface GameInfo
public interface GameInfo
Read-only game state for HUD widgets and addons – the same on every Minecraft version.
-
Method Summary
Modifier and TypeMethodDescriptionarmor(int slot) Worn armour: 0 = helmet, 1 = chestplate, 2 = leggings, 3 = boots; empty item when nothing is worneffects()Active potion effects of the player, empty outside a worldexample(int slot) Sample item for a slot (0–3 armour, 4 main hand, 5 off hand) – shown in the HUD editor when the slot is emptyintfps()booleanThis Minecraft version has an off hand (1.9+)booleaninWorld()false on the title screen and while a world is loadingbooleanShort name of the key bound to this action ("W", "Space", "LMB")mainHand()offHand()Off hand (1.9+); always empty on 1.8.9intping()Latency to the server in ms; -1 in singleplayer or when unknowndoublex()doubley()floatyaw()Player's horizontal look direction in degrees (Minecraft convention: 0 = south, 90 = west)doublez()
-
Method Details
-
fps
int fps() -
inWorld
boolean inWorld()false on the title screen and while a world is loading -
x
double x() -
y
double y() -
z
double z() -
yaw
float yaw()Player's horizontal look direction in degrees (Minecraft convention: 0 = south, 90 = west) -
ping
int ping()Latency to the server in ms; -1 in singleplayer or when unknown -
isDown
-
armor
Worn armour: 0 = helmet, 1 = chestplate, 2 = leggings, 3 = boots; empty item when nothing is worn -
mainHand
ItemView mainHand() -
offHand
ItemView offHand()Off hand (1.9+); always empty on 1.8.9 -
example
Sample item for a slot (0–3 armour, 4 main hand, 5 off hand) – shown in the HUD editor when the slot is empty -
hasOffHand
boolean hasOffHand()This Minecraft version has an off hand (1.9+) -
effects
List<StatusEffect> effects()Active potion effects of the player, empty outside a world -
keyName
-