Solved Inventory Slot number

Discussion in 'Plugin Development' started by ARCT3CK, Sep 14, 2014.

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

    ARCT3CK

    Need some help with this, currently i have the Itemstacks defined, also the PlayerJoinEvent defined

    Currently i need to set an item in that specific slot,

    [​IMG]

    I have used »

    Code:java
    1. p.getInventory().setItem(1, arcoTP);


    But it puts that item in the 2 slot of the quick item bar, i need to put the arrow on the Inventory gui, not the bar.
    My code »
    Code:java
    1. @EventHandler
    2. public void eventoGiveItem(PlayerJoinEvent event) {
    3. Player p = event.getPlayer();
    4. if (Main.config.arcoTP == true) {
    5. p.getInventory().setItem(1, flechaTP);
    6. p.updateInventory();
    7. }
    8. }
    9.  


    ... Apparently i don't need the arrow to fire my TP Bow, but if someone knowns the answer reply :D

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 14, 2016
  2. ARCT3CK
    From 0 to 8 is the hotbar, then it continues at the top left corner. The slot id you are looking for is 9. You can view all the slot ids here
    Show Spoiler
    [​IMG]
     
    ARCT3CK likes this.
  3. Offline

    ARCT3CK

    Assist oh, thank you so much, dind't knew this haha

    - Closing topic -
     
Thread Status:
Not open for further replies.

Share This Page