How to change custom created Inventory name?

Discussion in 'Plugin Development' started by Ibas, Jul 8, 2013.

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

    Ibas

    Code:java
    1. Inventory kompasas = getServer().createInventory(null, 27, "Menu");

    Is there any way after I define that I could change title name? Something like..:
    Code:java
    1. kompsas.setTitle("Menu2");
     
  2. Offline

    Windy Day

  3. Offline

    LeoFSU

    Short:

    Nope

    Long:

    http://jd.bukkit.org/rb/doxygen/d3/dad/interfaceorg_1_1bukkit_1_1inventory_1_1Inventory.html

    There is a bypass tho:

    Code:java
    1. Inventory kompasas = getServer().createInventory(null, 27, "Menu");
    2.  
    3. Inventory kompasas2 = getServer().createInventory(null, 27, "Menu2");
    4.  
    5. kompasas2.setContents(kompasas.getContents);


    Put it in some try/catch thing or it might create a null pointer exception/ IllegalArgumentException

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
Thread Status:
Not open for further replies.

Share This Page