Class DeferredRegister.Entities
java.lang.Object
net.neoforged.neoforge.registries.DeferredRegister<net.minecraft.world.entity.EntityType<?>>
net.neoforged.neoforge.registries.DeferredRegister.Entities
- Direct Known Subclasses:
DeferredEntityTypes
- Enclosing class:
DeferredRegister<T>
public static class DeferredRegister.Entities
extends DeferredRegister<net.minecraft.world.entity.EntityType<?>>
Specialized DeferredRegister for
EntityTypes
.-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.registries.DeferredRegister
DeferredRegister.Blocks, DeferredRegister.DataComponents, DeferredRegister.Entities, DeferredRegister.Items
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<E extends net.minecraft.world.entity.Entity>
DeferredHolder<net.minecraft.world.entity.EntityType<?>, net.minecraft.world.entity.EntityType<E>> registerEntityType
(String name, net.minecraft.world.entity.EntityType.EntityFactory<E> factory, net.minecraft.world.entity.MobCategory category) Convenience method that constructs a builder.<E extends net.minecraft.world.entity.Entity>
DeferredHolder<net.minecraft.world.entity.EntityType<?>, net.minecraft.world.entity.EntityType<E>> registerEntityType
(String name, net.minecraft.world.entity.EntityType.EntityFactory<E> factory, net.minecraft.world.entity.MobCategory category, UnaryOperator<net.minecraft.world.entity.EntityType.Builder<E>> builder) Convenience method that constructs a builder for use in the operator.Methods inherited from class net.neoforged.neoforge.registries.DeferredRegister
addAlias, create, create, create, createBlocks, createDataComponents, createEntities, createHolder, createItems, createTagKey, createTagKey, getEntries, getNamespace, getRegistry, getRegistryKey, getRegistryName, makeRegistry, register, register, register
-
Constructor Details
-
Entities
-
-
Method Details
-
registerEntityType
public <E extends net.minecraft.world.entity.Entity> DeferredHolder<net.minecraft.world.entity.EntityType<?>,net.minecraft.world.entity.EntityType<E>> registerEntityType(String name, net.minecraft.world.entity.EntityType.EntityFactory<E> factory, net.minecraft.world.entity.MobCategory category) Convenience method that constructs a builder. Use this to avoid inference issues.- Type Parameters:
E
- the type of the entity- Parameters:
name
- The name for this entity type. It will automatically have the namespace prefixed.factory
- The factory used to typically construct the entity when using an existing helper from the type.category
- The category of the entity, typicallyMobCategory.MISC
for non-living entities, or one of the others for living entities.- Returns:
- A
DeferredHolder
which reflects the data that will be registered.
-
registerEntityType
public <E extends net.minecraft.world.entity.Entity> DeferredHolder<net.minecraft.world.entity.EntityType<?>,net.minecraft.world.entity.EntityType<E>> registerEntityType(String name, net.minecraft.world.entity.EntityType.EntityFactory<E> factory, net.minecraft.world.entity.MobCategory category, UnaryOperator<net.minecraft.world.entity.EntityType.Builder<E>> builder) Convenience method that constructs a builder for use in the operator. Use this to avoid inference issues.- Type Parameters:
E
- the type of the entity- Parameters:
name
- The name for this entity type. It will automatically have the namespace prefixed.factory
- The factory used to typically construct the entity when using an existing helper from the type.category
- The category of the entity, typicallyMobCategory.MISC
for non-living entities, or one of the others for living entities.builder
- The unary operator, which is passed a new builder for user operators, then builds it upon registration.- Returns:
- A
DeferredHolder
which reflects the data that will be registered.
-