get Container Value
fun <Z : Any, T : Any> getContainerValue(item: ItemStack, key: NamespacedKey, type: PersistentDataType<T, Z>): Z?
Reads key of the given type from the item's PDC, or null if absent/no meta.
fun <Z : Any, T : Any> getContainerValue(holder: PersistentDataHolder, key: NamespacedKey, type: PersistentDataType<T, Z>): Z?
Reads key of the given type from the holder's PDC (entity, block state, …), or null.
fun <Z : Any, T : Any> getContainerValue(container: PersistentDataContainer, key: NamespacedKey, type: PersistentDataType<T, Z>): Z?
Reads key of the given type directly from a PersistentDataContainer, or null.
Reads key from the item's PDC, inferring the PersistentDataType from T.
Throws
if T has no supported PDC type
Reads key from the holder's PDC, inferring the type from T.
Reads key from a PersistentDataContainer, inferring the type from T.