getLocation

fun getLocation(holder: PersistentDataHolder, key: NamespacedKey): Location?

Reads a Location stored under key, or null if absent or its world is unloaded.


fun getLocation(item: ItemStack, key: NamespacedKey): Location?

Reads a Location stored under key on an item, or null if absent/world unloaded.