Setting HandItem Hotbar

Discussion in 'Plugin Development' started by FlareLine, May 6, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    FlareLine

    I would like to prohibit the ability to change the selected Hotbar slot. Is this possible?
    What I have now:
    Code:java
    1. public void run() {
    2. for(Player p : instance.getServer().getOnlinePlayers()) {
    3.  
    4. /* Hotbar Items */
    5. ItemStack aSlot1 = p.getInventory().getItem(0);
    6. ItemStack aSlot2 = p.getInventory().getItem(1);
    7. ItemStack aSlot3 = p.getInventory().getItem(2);
    8. ItemStack aSlot4 = p.getInventory().getItem(3);
    9. ItemStack quickUse1 = p.getInventory().getItem(4);
    10. ItemStack quickUse2 = p.getInventory().getItem(5);
    11. ItemStack nullSlot = p.getInventory().getItem(6);
    12. ItemStack secWeapon = p.getInventory().getItem(7);
    13. ItemStack priWeapon = p.getInventory().getItem(8);
    14.  
    15. if(p.getItemInHand() != priWeapon) {
    16. /*prohibit here*/
    17. }
    18. }
    19. }
     
  2. Offline

    AdamQpzm

  3. Offline

    FlareLine

    AdamQpzm likes this.
  4. Offline

    geret13

    Please set status to solved
     
  5. Offline

    FlareLine

    geret13 It's not solved yet, or else I would have done that.
    AdamQpzm Is it possible to set the cursor to a specific slot? I can't find any method to do so... :confused:
     
  6. Offline

    AdamQpzm

  7. Offline

    FlareLine

    AdamQpzm Can I like put you on quickreply so you can be my reference?;)
    Cheers again.
     
  8. Offline

    AdamQpzm

    FlareLine No problem. And you're free to do whatever you want - if I'm online and bored (which I probably will be) I'll help with essentially any problem I notice. :p
     
Thread Status:
Not open for further replies.

Share This Page