CraftItemEvent Not Firing

Discussion in 'Plugin Development' started by quaz3l, Mar 14, 2012.

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

    quaz3l

    When I use this code to track the CraftItemEvent, it doesn't work:
    Main Class:
    PHP:
    // ... Code ...
    public void onEnable()
    {
        
    // ... Code ...
        
    getServer().getPluginManager().registerEvents(new Craft(), this);
        
    // ... Code ...
    }
    Craft Class:
    PHP:
    // Imports
    public class Craft implements Listener {
        @
    EventHandler
        
    public void onCraftItem(CraftItemEvent e)
        {
            
    System.out.println("Hi");
        }
    }
    Why is this not working?

    When is this event fired?
     
  2. Offline

    ZeusAllMighty11

    I am having a similar issue, the Craftitemevent won't register, and won't make the item for me.

    Only happens to some items though.
     
  3. According to this topic: http://forums.bukkit.org/threads/new-inventory-framework.63337/

    Are you clicking the crafting result slot?
     
  4. Offline

    quaz3l

    Yes.

    I have read that and followed what it said but it doesn't work.

    I'd love to know if this event is not firing by error, or I'm just doing it wrong... Anyone?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 24, 2016
  5. Sorry, but at the moment I'm not using this so I can't test it. But a reply here to give this topic a bump!
     
  6. Offline

    quaz3l

    Thanks for trying anyway :)
     
  7. Offline

    nisovin

    There's nothing wrong with System.out.println for debugging purposes.

    On topic, I am also unable to get this event to work.

    My println calls always go to the console.

    Also, if you really want to use a logger, you should use the getLogger() method on your JavaPlugin class, not Logger.getLogger("Minecraft").

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

    quaz3l

    Yea its just for ease of putting it on here with out context. I do use logger though
     
  9. Offline

    nisovin

    It looks like this problem should be fixed as of build 2077.
     
  10. Offline

    quaz3l

    It seems that all the events coming of of inventoryevent do not work because I tried enchantitemevent and it doesn't work
     
  11. Offline

    VeryBIgCorp

    They probably haven't fully implemented them yet.
     
  12. Offline

    quaz3l

    Thats what I was thinking too.
     
  13. Offline

    nisovin

    EnchantItemEvent works fine, as do the rest of the inventory events.
     
  14. Offline

    quaz3l

    Thats weird, there not working for me...
     
  15. Offline

    nisovin

    Then you're doing something wrong.
     
  16. Offline

    quaz3l

    Got it. Enchant Event works...
     
Thread Status:
Not open for further replies.

Share This Page