Solved bukkit1.7.10 to 1.14.4, is Inventory.getName deleted?

Discussion in 'Plugin Development' started by leesj, Dec 5, 2019.

  1. Offline

    leesj

    when i use bukkit 1.7.10 there is Inventory.getName method, but, after i move to 1.14.4 there isn't!!!!!!

    now... how can i identify Inventory???
     
  2. Offline

    CraftCreeper6

    @leesj
    Use inv.getView().getTitle() instead of inv.getName()
     
    Last edited: Dec 5, 2019
  3. Offline

    KarimAKL

    Inventory doesn't have a getView() method, only InventoryEvent has that.


    @leesj You can get the inventory's name from an InventoryEvent, though if you don't need it in an event and the inventory is a chest, i believe you can cast Inventory#getHolder() to a Chest and then use Chest#getCustomName().
     
    CraftCreeper6 likes this.

Share This Page