Solved Inventory Error

Discussion in 'Plugin Development' started by thechrisanator, Nov 16, 2018.

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

    thechrisanator

    http://prntscr.com/ljf5q7

    Code:
    public void onInventoryClick(InventoryClickEvent event) {
            Player player = (Player) event.getWhoClicked();
            Inventory inv = event.getInventory();
            if (event.getClickedInventory().getTitle().equals(ChatColor.GREEN + "Multitools")) {
    something is returning null, but I'm not sure what
     
    Last edited: Nov 16, 2018
  2. Offline

    timtower Administrator Administrator Moderator

  3. Offline

    thechrisanator

    @timtower yes, eventually I fixed it.
    I put a check for event.getClickedInventory() != null because if you click outside the inventory it returns null
     
Thread Status:
Not open for further replies.

Share This Page