Custom inventory checking a few things

Discussion in 'Plugin Development' started by Neilnet, Jan 14, 2015.

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

    Neilnet

    When I make a custom inventory, I attempt to make an inventory menu.

    How do I do the following:
    - Check to see if the item clicked is NOT from the players inventory
     
  2. Offline

    AzureDev

    Just do:

    Code:
    if(!event.getInventory().getTitle().equalsIgnoreCase("Your title")) {
    //Player has clicked item which is not in your custom inventory. 
    } 
    or something along the lines of that.
     
  3. Offline

    Neilnet

    I do that, I although if the player clicks a stone in his inventory, it some how acts as if he clicked it from the custom inventory.
     
  4. Offline

    Hex_27

    @Neilnet What I do is add a lore to the inventory's items, if you really don't want a lore, you can add an empty lore like
    lore.add(ChatColor.RED +"" + ChatColor.BLUE + ""); Then check if the item clicked has a lore (ChatColor.RED +"" + ChatColor.BLUE + "")
     
    Neilnet likes this.
  5. Offline

    Neilnet

    That'll work, cheers.
     
Thread Status:
Not open for further replies.

Share This Page