Solved Inventory Crafting Grid Usable Items?

Discussion in 'Plugin Development' started by ItsRaage, Aug 29, 2018.

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

    ItsRaage

    Hello, I am curious about a function that would allow you to click an item in your inventory crafting grid and it doing an action, I may not be describing it well because its sort of strange but here is a gif of it in action,
    https://i.gyazo.com/0e2df1275b14e5a8e0ed4b70ad396617.mp4

    Is there any way to check for this on InventoryClickEvent? Is there a specific event for this? Or does anyone have any code examples or existing plugins I can view?
    I am requesting this information so I could use this in my server.

    //Solved please close thread
     
    Last edited: Aug 29, 2018
  2. Offline

    The_Spaceman

    As far that I understand is that you want to check if a player has made a custom crafting recipe?
    if then: you can create your own... and use a CraftItemEvent maybe...
     
  3. Offline

    ItsRaage

    To give it a little more detail, I am looking to make it so that when you left click an item it activates the use of that specific item, and that item that is going to be clicked has a custom mechanic to it.
    The gyazo gives a better example of it in visuals.
    https://i.gyazo.com/0e2df1275b14e5a8e0ed4b70ad396617.mp4
     
  4. @ItsRaage
    InventoryClickEvent, check if its the correct InventoryType and also check if it was the corrrect slot and then check if the clicked item is the correct item
     
  5. Offline

    ItsRaage

    Right, but how would I check if it was the correct slot?
    And how would I put an item in the crafting slot?
     
  6. @ItsRaage
    InventoryOpenEvent then you would add items in the inventory if its the correct inventory, thats if you want it in the players inventory, if you want to create your own inventory then its different

    also this is a little outdated but gives you an idea
    [​IMG]
     
  7. Offline

    The_Spaceman

    you can as Blackwing_forged said use a inventoryOpenEvent,
    when fired get the players inventory and set its content
    Code:java
    1. event.getPlayer().getInventory().setItem(0, new ItemStack(Material.STONE));

    replace the 0 to the correct slot (I dont know) and replace the itemStack with the items you want.

    and use a InventoryClickEvent to set you wanted action

    I hope you have all you nead to proceed with your plugin
     
  8. Offline

    ItsRaage

    Thanks for the help guys, me & my partner got it workin after a few hours lol. Appreciate all of the help!
    //Solved!
     
Thread Status:
Not open for further replies.

Share This Page