VitalInventory
Defines an inventory menu within the Vital-Framework. An inventory menu is a GUI used to display information to a player, and process a player's inputs.
By default, the class will be a bean.
@VitalInventory.Info(
name = "MyInventory",
type = VitalInventory.Type.GENERIC_9X1,
background = Material.COBBLESTONE
)
public class MyInventory extends VitalInventory {
@Override
public void onUpdate() {
// This function is called when someone or something triggers an inventory update.
// It should not be used to set player-specific items, only global ones.
}
@Override
public void onUpdate(Player player) {
// This function is called when someone or something triggers an inventory update with a player.
// It should be used to set player-specific items, not global ones.
}
// ...
}Inheritors
Types
Defines the info for a VitalInventory.
Defines the supported MenuTypes a VitalInventory can use.
Properties
Functions
Gets all mapped actions for the given playerUniqueId. This function will never return null, even if the given playerUniqueId doesn't have this inventory open.
Gets the actual InventoryView for the given playerUniqueId. This function will return null if the given playerUniqueId doesn't have this inventory open.
Gets all items for the given playerUniqueId. This function will never return null, even if the given playerUniqueId doesn't have this inventory open.
Checks if the given SpigotPlayer currently has this inventory open.
Opens this inventory for the given player and updates it via update. If a previousInventory was given, clicking outside of this inventory view will open the previous inventory.
Updates this inventory for all players currently viewing it. Calling this function will call the onUpdate lifecycle function.