Interface GameInfo


public interface GameInfo
Read-only game state for HUD widgets and addons – the same on every Minecraft version.
  • Method Summary

    Modifier and Type
    Method
    Description
    armor(int slot)
    Worn armour: 0 = helmet, 1 = chestplate, 2 = leggings, 3 = boots; empty item when nothing is worn
    Active potion effects of the player, empty outside a world
    example(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 empty
    int
    fps()
     
    boolean
    This Minecraft version has an off hand (1.9+)
    boolean
    false on the title screen and while a world is loading
    boolean
     
    Short name of the key bound to this action ("W", "Space", "LMB")
     
    Off hand (1.9+); always empty on 1.8.9
    int
    Latency to the server in ms; -1 in singleplayer or when unknown
    double
    x()
     
    double
    y()
     
    float
    yaw()
    Player's horizontal look direction in degrees (Minecraft convention: 0 = south, 90 = west)
    double
    z()
     
  • 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

      boolean isDown(GameKey key)
    • armor

      ItemView armor(int slot)
      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

      ItemView example(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 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

      String keyName(GameKey key)
      Short name of the key bound to this action ("W", "Space", "LMB")