public final class VillagerProfessionBuilder extends Object
VillagerProfessions.
The texture for the villagers are located at assets/IDENTIFIER_NAMESPACE/textures/entity/villager/profession/IDENTIFIER_PATH.png
A corresponding IDENTIFIER_PATH.mcmeta file exits in the same directory to define properties such as the HatType this profession would use.
Note this does not register any trades to these villagers. To register trades, add a new entry with your profession as the key to TradeOffers.PROFESSION_TO_LEVELED_TRADE.
| Modifier and Type | Method and Description |
|---|---|
net.minecraft.village.VillagerProfession |
build()
Creates the
VillagerProfession. |
static VillagerProfessionBuilder |
create()
Creates a builder instance to allow for creation of a
VillagerProfession. |
VillagerProfessionBuilder |
harvestableItems(net.minecraft.item.Item... items)
Items that a Villager may harvest in this profession.
|
VillagerProfessionBuilder |
harvestableItems(Iterable<net.minecraft.item.Item> items)
Items that a Villager may harvest in this profession.
|
VillagerProfessionBuilder |
id(net.minecraft.util.Identifier id)
The Identifier used to identify this villager profession.
|
VillagerProfessionBuilder |
secondaryJobSites(net.minecraft.block.Block... blocks)
A collection of blocks blocks which may suffice as a secondary job site for a Villager.
|
VillagerProfessionBuilder |
secondaryJobSites(Iterable<net.minecraft.block.Block> blocks)
A collection of blocks blocks which may suffice as a secondary job site for a Villager.
|
VillagerProfessionBuilder |
workSound(@Nullable net.minecraft.sound.SoundEvent workSoundEvent)
Provides the sound made when a Villager works.
|
VillagerProfessionBuilder |
workstation(net.minecraft.world.poi.PointOfInterestType type)
The
PointOfInterestType the Villager of this profession will search for when finding a workstation. |
public static VillagerProfessionBuilder create()
VillagerProfession.public VillagerProfessionBuilder id(net.minecraft.util.Identifier id)
id - The identifier to assign to this profession.public VillagerProfessionBuilder workstation(net.minecraft.world.poi.PointOfInterestType type)
PointOfInterestType the Villager of this profession will search for when finding a workstation.type - The PointOfInterestType the Villager will attempt to find.public VillagerProfessionBuilder harvestableItems(net.minecraft.item.Item... items)
In Vanilla, this is used by the farmer to define what type of crops the farmer can harvest.
items - Items harvestable by this profession.public VillagerProfessionBuilder harvestableItems(Iterable<net.minecraft.item.Item> items)
In Vanilla, this is used by the farmer to define what type of crops the farmer can harvest.
items - Items harvestable by this profession.public VillagerProfessionBuilder secondaryJobSites(net.minecraft.block.Block... blocks)
In Vanilla, this is used by the Farmer to stay near Farmland when at it's job site.
blocks - Collection of secondary job site blocks.public VillagerProfessionBuilder secondaryJobSites(Iterable<net.minecraft.block.Block> blocks)
In Vanilla, this is used by the Farmer to stay near Farmland when at it's job site.
blocks - Collection of secondary job site blocks.public VillagerProfessionBuilder workSound(@Nullable @Nullable net.minecraft.sound.SoundEvent workSoundEvent)
workSoundEvent - The SoundEvent to be played.public net.minecraft.village.VillagerProfession build()
VillagerProfession.VillagerProfession.IllegalStateException - if the builder is missing an id and workstation.