Wierd Error with BlockBreakEvent

Discussion in 'Plugin Development' started by CRAZYxMUNK3Y, Apr 15, 2012.

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

    CRAZYxMUNK3Y

    I have a small issue when using one Array for multiple classes, which are in separate packages.

    When i type the command, all works fine, but when i go to use the Listener, it doesn't work at all, no matter what command i use, even when i just start the server up.​

    The blocks will always break as originally made(By the Bukkit Team)/in Single Player​
    Listener

    Commands

    Sorry for a possible noob question :p

    Thanks
     
  2. you registered listener "Bukkit.getPluginManager().registerEvents(listener,plugin)"?
     
  3. Offline

    CRAZYxMUNK3Y

    Yes...
    But i used;

    Bukkit.getPluginManager().registerEvents(this.listener,this);

    instead
     
  4. you can add some debug staments to see if the collections contain what you want
     
  5. Offline

    IcyRelic

    Add this to the onEnable
    Bukkit.getServer().getPluginManager().registerEvents(new listener(this), this);
    and then add this to the top of your listener

    YOURMAINCLASS plugin;
    public listener( YOURMAINCLASS instance) {

    plugin = instance;

    }
     
  6. Offline

    CRAZYxMUNK3Y



    I got it to work, removed the "extends MAINCLASS" and made the constructor in the main, but now i have one small issue.

    When glowstone is set to drop, it works fine, but when glass/glass panes are meant to drop, it spits outs one glowstone dust, even though it is coded to drop glass/glass panes.

    When glowstone is set to be destroyed, this issue goes away?

    Why is it doing this?
    Thanks
     
Thread Status:
Not open for further replies.

Share This Page