getTopInventory

fun <T : Any> getTopInventory(clazz: KClass<T>, player: HumanEntity): T?

Gets the holder of the top inventory in the currently open inventory view.

Return

The top inventory holder of type T, or null if not found

Since

2.2.0

Parameters

clazz

The KClass of the inventory holder type

player

The player whose top inventory holder to check

Type Parameters

T

The inventory holder type


inline fun <T : Any> getTopInventory(player: HumanEntity): T?

Gets the holder of the top inventory in the currently open inventory view.

Return

The top inventory holder of type T, or null if not found

Since

2.2.0

Parameters

player

The player whose top inventory holder to check

Type Parameters

T

The inventory holder type