How to check player hot bar for item?

Discussion in 'Plugin Development' started by euller12, Jul 27, 2013.

?

How to check player hot bar for item?

  1. How to do it.

    1 vote(s)
    50.0%
  2. Knows what to do.

    1 vote(s)
    50.0%
Thread Status:
Not open for further replies.
  1. Offline

    euller12

    I am wondering how to check the player's hot bar to know if player should get an item or not.
     
  2. Offline

    JazzaG

    euller12
    Code:
    for(int i = 0; i < 9; i++) {
        ItemStack item = player.getInventory().getItem(i);
        if(item == null) continue;
     
        // Do something with item
    }
     
  3. Offline

    euller12

    thanks
     
Thread Status:
Not open for further replies.

Share This Page