InventoryGUI

abstract class InventoryGUI(player: Player) : InventoryHolder

Represents a base class for creating custom inventory GUIs in Minecraft. This class provides basic inventory manipulation methods and allows setting up buttons, listeners, and background materials for GUI customization.

Since

1.0.0

Author

RiriFa

Parameters

player

The player viewing the GUI.

Inheritors

Constructors

Link copied to clipboard
constructor(player: Player)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Represents the list of buttons to be displayed in this inventory GUI. Each button corresponds to a slot and can define its own material, name, custom data, and click behavior.

Functions

Link copied to clipboard

Adds a single item to the existing item list.

Link copied to clipboard
abstract fun build(): InventoryGUI

Abstract method for building the inventory GUI. This method should be implemented by subclasses to define the layout and items of the GUI.

Link copied to clipboard
fun close()

Closes the inventory for the player.

Link copied to clipboard
abstract fun getAllButtons(): List<Button>
Link copied to clipboard
fun getBackgroundMaterial(): Material?

Gets the background material set for the inventory GUI.

Link copied to clipboard
open override fun getInventory(): Inventory

Returns the inventory associated with this GUI.

Link copied to clipboard

Gets the current listener associated with this GUI.

Link copied to clipboard
fun getSize(): Int?

Gets the size of the inventory GUI.

Link copied to clipboard
fun getTitle(): Component?

Gets the title of this GUI.

Link copied to clipboard
fun open()

Opens the inventory for the player.

Link copied to clipboard
fun setBackground(background: Material): InventoryGUI

Sets the background material for the inventory GUI.

Link copied to clipboard

Sets multiple items at once for the GUI. This replaces the existing item list.

Link copied to clipboard

Sets the listener for handling GUI events.

Link copied to clipboard
fun setShouldCallGlobalListener(shouldCallGlobalListener: Boolean): InventoryGUI

Sets whether the global listener should be called on inventory events.

Link copied to clipboard

Sets the size of the inventory GUI.

Link copied to clipboard
fun setTitle(title: Component): InventoryGUI

Sets the title of the inventory GUI.

Link copied to clipboard

Indicates whether the global listener should be called on inventory events.