setData

fun Button.setData(key: NamespacedKey, wrapper: DataWrapper<*, *>): Button

Sets or replaces a single persistent data entry in the button.

Return

This Button instance with the updated data.

Parameters

key

The key to associate the data with.

wrapper

The DataWrapper containing the value and its type.