2 questions...

Discussion in 'Plugin Development' started by Alex_Cboy, Apr 26, 2014.

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

    Alex_Cboy

    Hello again, now i have 2 questions:
    1, this event doesnt work :
    Code:java
    1. @EventHandler
    2. public void onBagOpen(PlayerInteractEvent event) {
    3. Player player = event.getPlayer();
    4. Inventory baginv = Bukkit.createInventory(player, 18, "§e§lBag");
    5. if(player.getInventory().getItemInHand().getType() == Material.FLOWER_POT_ITEM && player.getItemInHand().getItemMeta().getDisplayName() == "§e§lBag") {
    6. if(event.getAction() == Action.RIGHT_CLICK_AIR) {
    7. player.openInventory(baginv);

    I have registered it correctly, the listener too.
    2, how to save in a arraylist or a list custom inventory?
     
  2. Offline

    Rocoty

    "Doesn't work" that is a bit vague. What makes you think it doesn't work? Have you added debug prints?
     
  3. Offline

    Alex_Cboy

    Rocoty
    It doesn't work just because it does nothing another event that is before this is working this doesn't.
     
  4. Offline

    Rocoty

    Thanks for clarifying that. "Doesn't work" could be anything. Add some debug prints. See how far you get
     
Thread Status:
Not open for further replies.

Share This Page