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.
  • Constructor Details

    • Entities

      protected Entities(String namespace)
  • 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, typically MobCategory.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, typically MobCategory.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.