getFrom

fun <P : Any, C : Any> getFrom(container: PersistentDataContainer, key: NamespacedKey, dataType: PersistentDataType<P, C>): DataWrapper<P, C>?

Retrieves a value from a PersistentDataContainer and wraps it in a DataWrapper.

Return

A DataWrapper containing the retrieved value if present, or null if no value is found.

Parameters

container

The PersistentDataContainer to retrieve the value from.

key

The NamespacedKey used to identify the data.

dataType

The PersistentDataType that specifies the type of the data.