DataComponentPredicates .java

net.minecraft.core.component.predicates.DataComponentPredicates (class): members: ATTRIBUTE_MODIFIERS, STORED_ENCHANTMENTS, FIREWORK_EXPLOSION, ARMOR_TRIM.

net.minecraft.core.component.predicatesclass40 linescommon2.8 KB

API Surface (1)

DataComponentPredicate.Type<?> bootstrap(final Registry<DataComponentPredicate.Type<?>> registry)

Fields & Constants (15)

DAMAGE
ENCHANTMENTS
STORED_ENCHANTMENTS
POTIONS
CUSTOM_DATA
CONTAINER
BUNDLE_CONTENTS
FIREWORK_EXPLOSION
FIREWORKS
WRITABLE_BOOK
WRITTEN_BOOK
ATTRIBUTE_MODIFIERS
ARMOR_TRIM
JUKEBOX_PLAYABLE
VILLAGER_VARIANT

String literals (15)

"damage"
"enchantments"
"stored_enchantments"
"potion_contents"
"custom_data"
"container"
"bundle_contents"
"firework_explosion"
"fireworks"
"writable_book_content"
"written_book_content"
"attribute_modifiers"
"trim"
"jukebox_playable"
"villager/variant"

Full Source

DataComponentPredicates.java40 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.core.component.predicates;
2
3
import com.mojang.serialization.Codec;
4
import net.minecraft.core.Registry;
5
import net.minecraft.core.registries.BuiltInRegistries;
6
7
public class DataComponentPredicates {
8
	public static final DataComponentPredicate.Type<DamagePredicate> DAMAGE = register("damage", DamagePredicate.CODEC);
9
	public static final DataComponentPredicate.Type<EnchantmentsPredicate.Enchantments> ENCHANTMENTS = register(
10
		"enchantments", EnchantmentsPredicate.Enchantments.CODEC
11
	);
12
	public static final DataComponentPredicate.Type<EnchantmentsPredicate.StoredEnchantments> STORED_ENCHANTMENTS = register(
13
		"stored_enchantments", EnchantmentsPredicate.StoredEnchantments.CODEC
14
	);
15
	public static final DataComponentPredicate.Type<PotionsPredicate> POTIONS = register("potion_contents", PotionsPredicate.CODEC);
16
	public static final DataComponentPredicate.Type<CustomDataPredicate> CUSTOM_DATA = register("custom_data", CustomDataPredicate.CODEC);
17
	public static final DataComponentPredicate.Type<ContainerPredicate> CONTAINER = register("container", ContainerPredicate.CODEC);
18
	public static final DataComponentPredicate.Type<BundlePredicate> BUNDLE_CONTENTS = register("bundle_contents", BundlePredicate.CODEC);
19
	public static final DataComponentPredicate.Type<FireworkExplosionPredicate> FIREWORK_EXPLOSION = register(
20
		"firework_explosion", FireworkExplosionPredicate.CODEC
21
	);
22
	public static final DataComponentPredicate.Type<FireworksPredicate> FIREWORKS = register("fireworks", FireworksPredicate.CODEC);
23
	public static final DataComponentPredicate.Type<WritableBookPredicate> WRITABLE_BOOK = register("writable_book_content", WritableBookPredicate.CODEC);
24
	public static final DataComponentPredicate.Type<WrittenBookPredicate> WRITTEN_BOOK = register("written_book_content", WrittenBookPredicate.CODEC);
25
	public static final DataComponentPredicate.Type<AttributeModifiersPredicate> ATTRIBUTE_MODIFIERS = register(
26
		"attribute_modifiers", AttributeModifiersPredicate.CODEC
27
	);
28
	public static final DataComponentPredicate.Type<TrimPredicate> ARMOR_TRIM = register("trim", TrimPredicate.CODEC);
29
	public static final DataComponentPredicate.Type<JukeboxPlayablePredicate> JUKEBOX_PLAYABLE = register("jukebox_playable", JukeboxPlayablePredicate.CODEC);
30
	public static final DataComponentPredicate.Type<VillagerTypePredicate> VILLAGER_VARIANT = register("villager/variant", VillagerTypePredicate.CODEC);
31
32
	private static <T extends DataComponentPredicate> DataComponentPredicate.Type<T> register(final String id, final Codec<T> codec) {
33
		return Registry.register(BuiltInRegistries.DATA_COMPONENT_PREDICATE_TYPE, id, new DataComponentPredicate.ConcreteType<>(codec));
34
	}
35
36
	public static DataComponentPredicate.Type<?> bootstrap(final Registry<DataComponentPredicate.Type<?>> registry) {
37
		return DAMAGE;
38
	}
39
}
40

Decompiled Minecraft 26.3 source of DataComponentPredicates (net/minecraft/core/component/predicates/DataComponentPredicates.java) with Mojang official mappings, stored verbatim on the site.