bound

@JvmName(name = "create")
fun <P : Any, C : Any> PersistentDataContainer.bound(key: String, type: PersistentDataType<P, C>): BoundEntry<P, C>(source)

Creates a bound entry for accessing persistent data within the container.

This method binds a PersistentDataContainer to a specific key and data type, returning a BoundEntry that allows retrieval of the associated value.

Return

A BoundEntry representing the binding of the key and type to the container.

Author

Fantamomo

Since

3.2-SNAPSHOT

Parameters

key

The key associated with the value in the persistent data container.

type

The PersistentDataType defining the primitive and complex types for the value.


@JvmName(name = "create")
fun <P : Any, C : Any> PersistentDataContainer.bound(key: String, type: PersistentDataType<P, C>, default: () -> C): DefaultBoundEntry<P, C>(source)

Creates a DefaultBoundEntry that is bound to the specified PersistentDataContainer. This entry allows the retrieval of a value using the specified key and type, with the capability to provide a default value if the key does not exist in the container.

Return

A DefaultBoundEntry bound to the specified container, key, and type with the specified default value.

Author

Fantamomo

Since

3.2-SNAPSHOT

Parameters

key

The key associated with the value in the PersistentDataContainer.

type

The PersistentDataType used to serialize and deserialize the value.

default

A lambda function that provides a default value if the key does not exist in the container.