Class AdvancementProviderBase
java.lang.Object
org.moddingx.libx.datagen.provider.AdvancementProviderBase
- All Implemented Interfaces:
net.minecraft.data.DataProvider
public abstract class AdvancementProviderBase
extends Object
implements net.minecraft.data.DataProvider
Base provider for custom
advancements
. If you want to have multiple advancement
tabs, use multiple providers. Every provider has one root advancement. All advancements with no
explicit parent will be added to it. You should configure your advancements with the root()
and advancement(String)
methods in setup
.-
Nested Class Summary
Modifier and TypeClassDescriptionclass
An advancement factory can be used to customise an advancement in a builder style pattern.static interface
A task factory can define multiple tasks.Nested classes/interfaces inherited from interface net.minecraft.data.DataProvider
net.minecraft.data.DataProvider.Factory<T extends net.minecraft.data.DataProvider>
-
Field Summary
Fields inherited from interface net.minecraft.data.DataProvider
FIXED_ORDER_FIELDS, KEY_COMPARATOR, LOGGER
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadvancement
(String id) Adds anadvancement
to the provider identified by an id.void
advancement
(net.minecraft.advancements.Advancement advancement) Adds a builtadvancement
to the provider.advancement
(net.minecraft.resources.ResourceLocation id) Adds an advancement to the provider identified by itsResourceLocation
.net.minecraft.advancements.CriterionTriggerInstance
changeDim
(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> from, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> to) Gets acriterion
that requires a player to perform a specific dimension change.net.minecraft.advancements.Advancement
dummy
(net.minecraft.resources.ResourceLocation id) Creates a dummyadvancement
with a given id to be used as a parent if your advancement should have another advancement from another mod as parent.net.minecraft.advancements.Advancement
dummy
(net.minecraft.resources.ResourceLocation id, boolean hidden) Creates a dummyadvancement
with a given id to be used as a parent if your advancement should have another advancement from another mod as parent.net.minecraft.advancements.CriterionTriggerInstance
eat
(net.minecraft.advancements.critereon.ItemPredicate food) Gets acriterion
that requires a player to consume (eat/drink) an item.net.minecraft.advancements.CriterionTriggerInstance
eat
(net.minecraft.tags.TagKey<net.minecraft.world.item.Item> food) Gets acriterion
that requires a player to consume (eat/drink) an item.net.minecraft.advancements.CriterionTriggerInstance
eat
(net.minecraft.world.level.ItemLike food) Gets acriterion
that requires a player to consume (eat/drink) an item.net.minecraft.advancements.CriterionTriggerInstance
enter
(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Gets acriterion
that requires a player to enter a dimension.net.minecraft.advancements.critereon.ContextAwarePredicate
entity
(net.minecraft.advancements.critereon.EntityPredicate entity) Gets the givenEntityPredicate
as anContextAwarePredicate
.net.minecraft.advancements.critereon.ContextAwarePredicate
entity
(net.minecraft.world.entity.EntityType<?> type) Gets anContextAwarePredicate
that matches for a specific entity type.getName()
net.minecraft.advancements.CriterionTriggerInstance
items
(net.minecraft.advancements.critereon.ItemPredicate... items) Gets acriterion
that requires all of the given items to be in the inventory at the same time.final net.minecraft.advancements.CriterionTriggerInstance
items
(net.minecraft.tags.TagKey<net.minecraft.world.item.Item>... items) Gets acriterion
that requires all of the given items to be in the inventory at the same time.net.minecraft.advancements.CriterionTriggerInstance
items
(net.minecraft.world.level.ItemLike... items) Gets acriterion
that requires all of the given items to be in the inventory at the same time.itemTasks
(net.minecraft.advancements.critereon.ItemPredicate... items) Gets aAdvancementProviderBase.TaskFactory
that adds a task for every item given to this method.itemTasks
(net.minecraft.tags.TagKey<net.minecraft.world.item.Item>... items) Gets aAdvancementProviderBase.TaskFactory
that adds a task for every item given to this method.itemTasks
(net.minecraft.world.level.ItemLike... items) Gets aAdvancementProviderBase.TaskFactory
that adds a task for every item given to this method.net.minecraft.advancements.CriterionTriggerInstance
leave
(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Gets acriterion
that requires a player to leave a dimension.root()
Gets anAdvancementProviderBase.AdvancementFactory
to customise the rootadvancement
for this provider.Gets anAdvancementProviderBase.AdvancementFactory
to customise the rootadvancement
for this provider.Gets anAdvancementProviderBase.AdvancementFactory
to customise the rootadvancement
for this provider.run
(net.minecraft.data.CachedOutput cache) abstract void
setup()
net.minecraft.advancements.critereon.ItemPredicate
stack
(net.minecraft.tags.TagKey<net.minecraft.world.item.Item> item, net.minecraft.world.item.enchantment.Enchantment... enchs) Gets anItemPredicate
for an item and optionally some enchantments.net.minecraft.advancements.critereon.ItemPredicate
stack
(net.minecraft.world.item.enchantment.Enchantment... enchs) Gets anItemPredicate
for some enchantments.net.minecraft.advancements.critereon.ItemPredicate
stack
(net.minecraft.world.item.enchantment.Enchantment ench, int min) Gets anItemPredicate
for an enchantment with a minimum level.net.minecraft.advancements.critereon.ItemPredicate
stack
(net.minecraft.world.level.ItemLike item, net.minecraft.world.item.enchantment.Enchantment... enchs) Gets anItemPredicate
for an item and optionally some enchantments.
-
Field Details
-
mod
-
packTarget
-
-
Constructor Details
-
AdvancementProviderBase
-
-
Method Details
-
setup
public abstract void setup() -
getName
- Specified by:
getName
in interfacenet.minecraft.data.DataProvider
-
run
- Specified by:
run
in interfacenet.minecraft.data.DataProvider
-
root
Gets anAdvancementProviderBase.AdvancementFactory
to customise the rootadvancement
for this provider. The root id will be the modid.- See Also:
-
root
Gets anAdvancementProviderBase.AdvancementFactory
to customise the rootadvancement
for this provider.- Parameters:
id
- The root id. The actual advancement id will bemodid:id/root
- See Also:
-
root
Gets anAdvancementProviderBase.AdvancementFactory
to customise the rootadvancement
for this provider.- Parameters:
namespace
- The namespace of the root advancement.id
- The root id. The actual advancement id will benamespace:id/root
-
advancement
public void advancement(net.minecraft.advancements.Advancement advancement) Adds a builtadvancement
to the provider. -
advancement
public AdvancementProviderBase.AdvancementFactory advancement(net.minecraft.resources.ResourceLocation id) Adds an advancement to the provider identified by itsResourceLocation
. Returns anAdvancementProviderBase.AdvancementFactory
to customise the advancement. -
advancement
Adds anadvancement
to the provider identified by an id. TheResourceLocation
is built with the modid and the root advancement id. Returns anAdvancementProviderBase.AdvancementFactory
to customise the advancement. -
dummy
public net.minecraft.advancements.Advancement dummy(net.minecraft.resources.ResourceLocation id) Creates a dummyadvancement
with a given id to be used as a parent if your advancement should have another advancement from another mod as parent. -
dummy
public net.minecraft.advancements.Advancement dummy(net.minecraft.resources.ResourceLocation id, boolean hidden) Creates a dummyadvancement
with a given id to be used as a parent if your advancement should have another advancement from another mod as parent.- Parameters:
hidden
- Whether the advancement is hidden.
-
items
public net.minecraft.advancements.CriterionTriggerInstance items(net.minecraft.world.level.ItemLike... items) Gets acriterion
that requires all of the given items to be in the inventory at the same time. -
items
@SafeVarargs public final net.minecraft.advancements.CriterionTriggerInstance items(net.minecraft.tags.TagKey<net.minecraft.world.item.Item>... items) Gets acriterion
that requires all of the given items to be in the inventory at the same time. -
items
public net.minecraft.advancements.CriterionTriggerInstance items(net.minecraft.advancements.critereon.ItemPredicate... items) Gets acriterion
that requires all of the given items to be in the inventory at the same time. -
itemTasks
Gets aAdvancementProviderBase.TaskFactory
that adds a task for every item given to this method. -
itemTasks
@SafeVarargs public final AdvancementProviderBase.TaskFactory itemTasks(net.minecraft.tags.TagKey<net.minecraft.world.item.Item>... items) Gets aAdvancementProviderBase.TaskFactory
that adds a task for every item given to this method. -
itemTasks
public AdvancementProviderBase.TaskFactory itemTasks(net.minecraft.advancements.critereon.ItemPredicate... items) Gets aAdvancementProviderBase.TaskFactory
that adds a task for every item given to this method. -
eat
public net.minecraft.advancements.CriterionTriggerInstance eat(net.minecraft.world.level.ItemLike food) Gets acriterion
that requires a player to consume (eat/drink) an item. -
eat
public net.minecraft.advancements.CriterionTriggerInstance eat(net.minecraft.tags.TagKey<net.minecraft.world.item.Item> food) Gets acriterion
that requires a player to consume (eat/drink) an item. -
eat
public net.minecraft.advancements.CriterionTriggerInstance eat(net.minecraft.advancements.critereon.ItemPredicate food) Gets acriterion
that requires a player to consume (eat/drink) an item. -
leave
public net.minecraft.advancements.CriterionTriggerInstance leave(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Gets acriterion
that requires a player to leave a dimension. -
enter
public net.minecraft.advancements.CriterionTriggerInstance enter(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Gets acriterion
that requires a player to enter a dimension. -
changeDim
public net.minecraft.advancements.CriterionTriggerInstance changeDim(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> from, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> to) Gets acriterion
that requires a player to perform a specific dimension change. -
entity
public net.minecraft.advancements.critereon.ContextAwarePredicate entity(net.minecraft.advancements.critereon.EntityPredicate entity) Gets the givenEntityPredicate
as anContextAwarePredicate
. -
entity
public net.minecraft.advancements.critereon.ContextAwarePredicate entity(net.minecraft.world.entity.EntityType<?> type) Gets anContextAwarePredicate
that matches for a specific entity type. -
stack
public net.minecraft.advancements.critereon.ItemPredicate stack(net.minecraft.world.level.ItemLike item, net.minecraft.world.item.enchantment.Enchantment... enchs) Gets anItemPredicate
for an item and optionally some enchantments. -
stack
public net.minecraft.advancements.critereon.ItemPredicate stack(net.minecraft.tags.TagKey<net.minecraft.world.item.Item> item, net.minecraft.world.item.enchantment.Enchantment... enchs) Gets anItemPredicate
for an item and optionally some enchantments. -
stack
public net.minecraft.advancements.critereon.ItemPredicate stack(net.minecraft.world.item.enchantment.Enchantment... enchs) Gets anItemPredicate
for some enchantments. -
stack
public net.minecraft.advancements.critereon.ItemPredicate stack(net.minecraft.world.item.enchantment.Enchantment ench, int min) Gets anItemPredicate
for an enchantment with a minimum level.
-