Class VillagerProfessionBuilder
VillagerProfession
s.
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
.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Deprecated.Creates theVillagerProfession
.static VillagerProfessionBuilder
create()
Deprecated.Creates a builder instance to allow for creation of aVillagerProfession
.harvestableItems
(Iterable<Item> items) Deprecated.Items that a Villager may harvest in this profession.harvestableItems
(Item... items) Deprecated.Items that a Villager may harvest in this profession.id
(Identifier id) Deprecated.The Identifier used to identify this villager profession.jobSite
(Predicate<RegistryEntry<PointOfInterestType>> predicate) Deprecated.secondaryJobSites
(Iterable<Block> blocks) Deprecated.A collection of blocks blocks which may suffice as a secondary job site for a Villager.secondaryJobSites
(Block... blocks) Deprecated.A collection of blocks blocks which may suffice as a secondary job site for a Villager.workSound
(@Nullable SoundEvent workSoundEvent) Deprecated.Provides the sound made when a Villager works.workstation
(Predicate<RegistryEntry<PointOfInterestType>> predicate) Deprecated.ThePointOfInterestType
the Villager of this profession will search for when finding a workstation.Deprecated.ThePointOfInterestType
the Villager of this profession will search for when finding a workstation.
-
Method Details
-
create
Deprecated.Creates a builder instance to allow for creation of aVillagerProfession
.- Returns:
- A new builder.
-
id
Deprecated.The Identifier used to identify this villager profession.- Parameters:
id
- The identifier to assign to this profession.- Returns:
- this builder
-
workstation
Deprecated.ThePointOfInterestType
the Villager of this profession will search for when finding a workstation.- Parameters:
key
- ThePointOfInterestType
the Villager will attempt to find.- Returns:
- this builder.
-
workstation
public VillagerProfessionBuilder workstation(Predicate<RegistryEntry<PointOfInterestType>> predicate) Deprecated.ThePointOfInterestType
the Villager of this profession will search for when finding a workstation.- Parameters:
predicate
- ThePointOfInterestType
the Villager will attempt to find.- Returns:
- this builder.
-
jobSite
Deprecated. -
harvestableItems
Deprecated.Items that a Villager may harvest in this profession.In Vanilla, this is used by the farmer to define what type of crops the farmer can harvest.
- Parameters:
items
- Items harvestable by this profession.- Returns:
- this builder.
-
harvestableItems
Deprecated.Items that a Villager may harvest in this profession.In Vanilla, this is used by the farmer to define what type of crops the farmer can harvest.
- Parameters:
items
- Items harvestable by this profession.- Returns:
- this builder.
-
secondaryJobSites
Deprecated.A collection of blocks blocks which may suffice as a secondary job site for a Villager.In Vanilla, this is used by the
Farmer
to stay nearFarmland
when at it's job site.- Parameters:
blocks
- Collection of secondary job site blocks.- Returns:
- this builder.
-
secondaryJobSites
Deprecated.A collection of blocks blocks which may suffice as a secondary job site for a Villager.In Vanilla, this is used by the
Farmer
to stay nearFarmland
when at it's job site.- Parameters:
blocks
- Collection of secondary job site blocks.- Returns:
- this builder.
-
workSound
Deprecated.Provides the sound made when a Villager works.- Parameters:
workSoundEvent
- TheSoundEvent
to be played.- Returns:
- this builder.
-
build
Deprecated.Creates theVillagerProfession
.- Returns:
- a new
VillagerProfession
. - Throws:
IllegalStateException
- if the builder is missing anid
andworkstation
.
-
VillagerProfession(java.lang.String, java.util.function.Predicate<net.minecraft.util.registry.RegistryEntry<net.minecraft.world.poi.PointOfInterestType>>, java.util.function.Predicate<net.minecraft.util.registry.RegistryEntry<net.minecraft.world.poi.PointOfInterestType>>, com.google.common.collect.ImmutableSet<net.minecraft.item.Item>, com.google.common.collect.ImmutableSet<net.minecraft.block.Block>, net.minecraft.sound.SoundEvent)
in Fabric Transitive Access Wideners (v1).