persistent Data
inline fun <T> persistentData(key: NamespacedKey, type: PersistentDataType<*, T & Any>, crossinline default: () -> T): ReadWriteProperty<PersistentDataHolder, T>(source)
Acts as a property delegate for stuff contained inside a PersistentDataContainer For example:
val numberOfTimesJumped: Int by persistentData(NamespacedKey(yourPlugin, "jumped"), PersistentDataType.INTEGER) { 0 }Content copied to clipboard
fun <T> persistentData(key: NamespacedKey, type: PersistentDataType<*, T & Any>, default: T): <Error class: unknown class>(source)
Same as persistentData but with a default value that is constant