How to get a player's crafting inventory?

Discussion in 'Plugin Development' started by Rprrr, Jan 24, 2013.

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

    Rprrr

    Hi,

    I was wondering how I could get a player's crafting inventory (the 4 slots + the result slot). Does anyone know how to do this? I couldn't find any method for it. :s

    I need this to put something in the result slot.

    Thanks in advance.
     
  2. Offline

    Cjreek

    As far as I know the slots 1-4 are the crafting slots and 0 is the result slot.
     
  3. Offline

    Rprrr

    Cjreek
    I know that, but how do I place something in that slot? How would I get the inventory?
     
  4. Offline

    Cjreek

  5. Offline

    Rprrr

    Cjreek
    I believe that returns the PlayerInventory, not the CraftingInventory. :s
     
  6. Offline

    Cjreek

    try this out. I bet it works ;-)

    Code:java
    1. player.getInventory().getOpenInventory().getTopInventory()


    is the crafting inventory without the player inventory underneath.
    But my code above should work, too.

    (Altough I'm not sure if you can set the result like this)
     
    PDKnight likes this.
  7. Offline

    Rprrr

    Cjreek
    That might work indeed. Thanks for the suggestion, I'll tell you if it works. :)
     
Thread Status:
Not open for further replies.

Share This Page