onInventoryOpen not called?

Discussion in 'Plugin Development' started by vildaberper, Apr 16, 2011.

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

    vildaberper

    Whats wrong with this?
    It wont get called when a player opens his/her inventory.

    Main class:
    Code:
    package com.vildaberper.InventoryExpander;
    
    import org.bukkit.event.Event.Priority;
    import org.bukkit.event.Event.Type;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class InventoryExpander extends JavaPlugin{
    	private final InventoryExpanderPlayerListener playerListener = new InventoryExpanderPlayerListener();
    
    	@Override
    	public void onDisable(){
    		System.out.println(this.getDescription().getName() + " " + this.getDescription().getVersion() + " is disabled.");
    	}
    	@Override
    	public void onEnable(){
    		this.getServer().getPluginManager().registerEvent(Type.INVENTORY_OPEN, playerListener, Priority.High, this);
    		System.out.println(this.getDescription().getName() + " " + this.getDescription().getVersion() + " is enabled.");
    	}
    }
    
    PlayerListener:
    Code:
    package com.vildaberper.InventoryExpander;
    
    import org.bukkit.event.player.PlayerInventoryEvent;
    import org.bukkit.event.player.PlayerListener;
    
    public class InventoryExpanderPlayerListener extends PlayerListener{
    	@Override
    	public void onInventoryOpen(PlayerInventoryEvent event){
    		event.getPlayer().sendMessage("derp");
    		System.out.println("derp");
    	}
    }
    
     
  2. Offline

    PurelySatanic

    EDIT:

    Nevermind, after writing it from scratch on my own I also cannot get it to work.

    I notice a pull request on the bukkit github for Inventory Open/Close so that would suggest to me that they haven't been properly implemented.
     
  3. Offline

    vildaberper

    Ah, I guess thats why. Thanks.
    I was going crazy. :(
     
  4. Offline

    Acrobot

    I tried the same, I guess it's not implemented yet.
     
Thread Status:
Not open for further replies.

Share This Page