Class help

Discussion in 'Plugin Development' started by billman555555, Sep 9, 2013.

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

    billman555555

    I have a main class for my plugin called Blitz,
    I need to make a second class called BlitzStar with a method called BlitzStar.blitzTime,
    But the blitzTime method needs to call the InventoryClickEvent, how would I do this?

    I have tried:
    Code:
    public void onInvntoryClick(InventoryClickEvent event) {
    Player player = event.getWhoClicked();
    BlitzStar.blitzTime();
    }
    
    But it didn't work.
     
  2. Offline

    Tarestudio

    billman555555
    Needs to call, or needs to listen to?
    If first, you have to create a instance of the event and call it by the server.
    For Second, you have to add @EventHandler one line over 'public void onIn...', let this class implement Listener and register the event at the PluginManager. Mor: http://wiki.bukkit.org/Event_API_Reference
     
  3. Offline

    billman555555

    Tarestudio
    That's what I forgot to do!
    Thank you!!!
     
Thread Status:
Not open for further replies.

Share This Page