ACustomDataIngredient¶
Custom ingredient that matches stacks accepted by base whose minecraft:custom_data component NBT is matched by nbt (a partial/sub-tag match, not exact equality). Build via of.
Types¶
Companion¶
object Companion
Serializer¶
Properties¶
base¶
val base: Ingredient
matchingStacks¶
open override val matchingStacks: MutableList<ItemStack>
The stacks that match this ingredient, for display purposes (e.g. in a recipe viewer).
Guidelines for good compatibility:
-
These stacks need not be exhaustive or perfectly accurate, except when
requiresTestingisfalse, in which case they must correspond exactly to every accepted item. -
At least one stack must be returned, or the ingredient is considered empty.
-
Try to include at least one stack per accepted item, so inspecting mods can enumerate what the ingredient might accept.
No caching is required here; the ingredient itself already caches this.
nbt¶
val nbt: CompoundTag
Non-empty NBT that a matching stack's custom data must be matched by.
requiresTesting¶
open override val requiresTesting: Boolean = true
Whether test must always be called to know if a stack matches, as opposed to relying on matchingStacks alone. false when this ingredient ignores extra stack data (like components/NBT) and matching is fully determined by item type.
serializer¶
open override val serializer: IACustomIngredientSerializer<*>
The serializer for this ingredient. Must have been registered via IACustomIngredientSerializer.register.
vanilla¶
@get:
ApiStatus.NonExtendable
open val vanilla: Ingredient
Converts this custom ingredient into a vanilla Ingredient behaving the same way.