UiEntry

data class UiEntry(val item: () -> ItemStack, val action: (Ui, Player) -> Unit = { _, _ -> }, val dynamic: Boolean = false)

Representation of an Ui Entry, which is an item in an Ui.

Parameters

item

the item that should be displayed in the slot (as a function, so it can be dynamic)

action

the action that should be executed when a player clicks on the item. The action should return true if the UI should be closed after the action is executed, false otherwise.

dynamic

if true, this item will be updated at least every tick (20 times per second)

Constructors

Link copied to clipboard
constructor(item: () -> ItemStack, action: (Ui, Player) -> Unit = { _, _ -> }, dynamic: Boolean = false)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val action: (Ui, Player) -> Unit
Link copied to clipboard
val dynamic: Boolean = false
Link copied to clipboard
val item: () -> ItemStack