Class VillagerTypeHelper

java.lang.Object
net.fabricmc.fabric.api.object.builder.v1.villager.VillagerTypeHelper

@Deprecated public final class VillagerTypeHelper extends Object
Deprecated.
Replaced by access wideners for VillagerType.create(java.lang.String) and VillagerType.BIOME_TO_TYPE in Fabric Transitive Access Wideners (v1).
Utilities related to the creation of VillagerTypes. Not to be confused with a VillagerProfession, a villager type defines the appearance of a villager.

Creation and registration of custom villager types may be done by using register(Identifier).

Creation and registration of a villager type does not guarantee villagers of a specific type will be created in a world. Typically the villager type is bound to a specific group of biomes. To allow a villager type to be spawned in a specific biome, use addVillagerTypeToBiome(RegistryKey, VillagerType).

The texture used for the appearance of the villager is located at assets/IDENTIFIER_NAMESPACE/textures/entity/villager/type/IDENTIFIER_PATH.png.

  • Method Details

    • register

      public static VillagerType register(Identifier id)
      Deprecated.
      Creates and registers a new villager type.
      Parameters:
      id - the id of the villager type
      Returns:
      a new villager type
    • addVillagerTypeToBiome

      public static void addVillagerTypeToBiome(RegistryKey<Biome> biomeKey, VillagerType villagerType)
      Deprecated.
      Sets the biome a villager type can spawn in.
      Parameters:
      biomeKey - the registry key of the biome
      villagerType - the villager type