KItemBehavior

Constructors

Link copied to clipboard
constructor(identifier: KIdentifier)

Properties

Link copied to clipboard
var executor: ItemStack.(KItemBehaviorContext) -> Unit?
Link copied to clipboard
open override val identifier: KIdentifier

Unique identifier for a behavior. This identifier is used to uniquely register a behavior within a registry and is composed of the plugin's name and a specific string identifier.

Functions

Link copied to clipboard
open override fun behave(block: ItemStack.(context: KItemBehaviorContext) -> Unit)

Sets the behavior logic for a target of type T within a specific context of type C. The behavior logic is provided in the form of a lambda function.

Link copied to clipboard
fun KBehavior<*, *>.register()

Registers this behavior within the global behavior registry.

Link copied to clipboard
open override fun run(target: ItemStack, context: KItemBehaviorContext)

Executes the behavior logic for the specified target within the provided context.