Event when player Pickup an item in a furnace

Discussion in 'Plugin Development' started by Jagang, Aug 10, 2012.

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

    Jagang

    Hello,
    So, all is in the title. I need to know when a player get an item in a furnace.

    Cordially
    Jagang
     
  2. Offline

    travja

  3. Offline

    Jagang

    It's not when the bloc is burned ?
     
  4. Offline

    travja

    So you want it when they actually take the item out or after it finishes smelting?
     
  5. Offline

    Jagang

    When the player takes the item.
     
  6. Offline

    travja

    My advice would be after it smelts because they can put things in the furnace and take them out therefore bypassing the whole smelting process and getting at whatever reward you are handing out in your plugin.

    That or log when the furnace starts burning and what should come out, and when they take it out, check if it's that item.... but, I'm not quite sure how to approach that.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 27, 2016
  7. Offline

    Jagang

    Ok, so... I go to try to use Metadata. Because, my main problem is : how to know who use the Furnace. So, I tried to know who takes the item. I go to know who put the item, save it on Metadata and use it on FurnaceBurnEvent.

    Thank you

    Jag
     
  8. Offline

    Vandrake

    Sorry to dig this out,

    org.bukkit.event.inventory.FurnaceExtractEvent
     
  9. Offline

    Scizzr

    What about the InventoryClickEvent? It fires when you click in any inventory. Just check that the inventory type (event.getInventory().getType()) is InventoryType.FURNACE. Good to go.

    Code:
    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {
        Inventory inv = event.getInventory();
        InventoryType invType = inv.getType();
        if (invType == InventoryType.FURNACE) {
            //...
        }
    }
    
     
Thread Status:
Not open for further replies.

Share This Page