public final class VillagerTypeHelper extends Object
VillagerType
s.
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
.
Modifier and Type | Method and Description |
---|---|
static void |
addVillagerTypeToBiome(net.minecraft.util.registry.RegistryKey<net.minecraft.world.biome.Biome> biomeKey,
net.minecraft.village.VillagerType villagerType)
Sets the biome a villager type can spawn in.
|
static net.minecraft.village.VillagerType |
register(net.minecraft.util.Identifier id)
Creates and registers a new villager type.
|
public static net.minecraft.village.VillagerType register(net.minecraft.util.Identifier id)
id
- the id of the villager typepublic static void addVillagerTypeToBiome(net.minecraft.util.registry.RegistryKey<net.minecraft.world.biome.Biome> biomeKey, net.minecraft.village.VillagerType villagerType)
biomeKey
- the registry key of the biomevillagerType
- the villager type