[help] Custom Inventory Bug

Discussion in 'WIP and Development Status' started by beaudigi, Apr 21, 2014.

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

    beaudigi

    I cant understand why this dosent work; and its driving me crazy :D Please help :D

    Code:java
    1. public void onDisable() {
    2. Bukkit.getServer().getLogger().info("Gui Plugin Disabled!");
    3. }
    4.  
    5. public void onPlayerInteract(PlayerInteractEvent event) {
    6. Player player = event.getPlayer();
    7. if (!(event.getAction() == Action.RIGHT_CLICK_AIR)) return;
    8.  
    9. if (!(event.getItem().getType() == Material.IRON_SPADE)) return;
    10.  
    11. player.openInventory(inv);
    12. }
    13.  
    14.  
    15.  
    16. ItemStack paper = new ItemStack(Material.PAPER);
    17. {
    18. ItemMeta itemmeta = paper.getItemMeta();
    19. ArrayList<String> im = new ArrayList<String>();
    20. itemmeta.setDisplayName(ChatColor.GOLD + "Antillus");
    21. im.add(ChatColor.GREEN + "A ticket to the land Antillus");
    22. im.add(ChatColor.YELLOW + "" + ChatColor.BOLD + "$250");
    23. itemmeta.setLore(im);
    24. paper.setItemMeta(itemmeta);
    25. }
    26.  
    27. Inventory inv = Bukkit.createInventory(null, 18, ChatColor.AQUA + "Tickets");
    28. {
    29. inv.addItem(paper);
    30. }
    31. }
    32.  
     
  2. beaudigi This is WIP and Development Status...
     
  3. Offline

    beaudigi

    Well it said "to post your bug" :p anyway this is a WIP gui :
     
  4. beaudigi Im not going to help here lol, its should go on Plugin Development forums... "Works in progress and status of plugins being ported can be found here."
     
  5. Offline

    ZeusAllMighty11 Retired Staff

    You are missing the '@EventHandler' annotation above your interact method.
     
    glen3b and Mathias Eklund like this.
  6. Offline

    beaudigi

    Thanks :D
     
Thread Status:
Not open for further replies.

Share This Page