Owner in createInventory

Discussion in 'Spigot Help' started by jackYodil, Jan 28, 2020.

  1. Can anyone please explain in detail what the "owner" variable in Bukkit#createInventory handles?
     
  2. The owner variable of the Bukkit#createInventory method means the "owner" of the inventory. So if you set it to a player, only the player can see the items in the inventory, useful for profile inventories or something. If you set it to null, everyone can see the same items, with the main auction house inventory.

    I don't know if you understand it know, tell me if not!
     
  3. This isn't true. The InventoryHolder does not determine who can view its contents, it only represents the entity or tile entity (i.e.: furnace, chest, shulker box, etc.) that the inventory belongs to.
    Some devs also implement the InventoryHolder interface as an identifier for the inventory, but this is not its intended purpose and should not be used as such.
     
    • Informative Informative x 2
    • Agree Agree x 1