Interface RegistryObject<T>
- Type Parameters:
T- the type of the object
- All Superinterfaces:
Supplier<T>
Represents a lazy wrapper for registry object.
-
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.core.Holder<T> asHolder()Gets this object wrapped in a vanillaHolder.get()Gets the object behind this wrapper.net.minecraft.resources.ResourceLocationgetId()Gets the id of the object.net.minecraft.resources.ResourceKey<T> Gets theResourceKeyof the registry of the object wrapped.
-
Method Details
-
getResourceKey
net.minecraft.resources.ResourceKey<T> getResourceKey()Gets theResourceKeyof the registry of the object wrapped.- Returns:
- the
ResourceKeyof the registry
-
getId
net.minecraft.resources.ResourceLocation getId()Gets the id of the object.- Returns:
- the id of the object
-
get
T get()Gets the object behind this wrapper. Calling this method too early might result in crashes. -
asHolder
net.minecraft.core.Holder<T> asHolder()Gets this object wrapped in a vanillaHolder.- Returns:
- the holder
-