EnchantmentValueEffect .java

net.minecraft.world.item.enchantment.effects.EnchantmentValueEffect (interface, 28 lines): members: process, bootstrap, codec, CODEC. strings: "multiply".

net.minecraft.world.item.enchantment.effectsinterface28 linescommon1.1 KB

API Surface (0)

No public/protected methods detected (fields or constants only).

Fields & Constants (1)

CODEC

String literals (4)

"all_of"
"multiply"
"remove_binomial"
"exponential"

Code Graph: Dependencies (3)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

EnchantmentValueEffect.java28 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.item.enchantment.effects;
2
3
import com.mojang.serialization.Codec;
4
import com.mojang.serialization.MapCodec;
5
import java.util.function.Function;
6
import net.minecraft.core.Registry;
7
import net.minecraft.core.registries.BuiltInRegistries;
8
import net.minecraft.util.RandomSource;
9
10
public interface EnchantmentValueEffect {
11
	Codec<EnchantmentValueEffect> CODEC = BuiltInRegistries.ENCHANTMENT_VALUE_EFFECT_TYPE
12
		.byNameCodec()
13
		.dispatch(EnchantmentValueEffect::codec, Function.identity());
14
15
	static MapCodec<? extends EnchantmentValueEffect> bootstrap(final Registry<MapCodec<? extends EnchantmentValueEffect>> registry) {
16
		Registry.register(registry, "add", AddValue.CODEC);
17
		Registry.register(registry, "all_of", AllOf.ValueEffects.CODEC);
18
		Registry.register(registry, "multiply", MultiplyValue.CODEC);
19
		Registry.register(registry, "remove_binomial", RemoveBinomial.CODEC);
20
		Registry.register(registry, "exponential", ScaleExponentially.CODEC);
21
		return Registry.register(registry, "set", SetValue.CODEC);
22
	}
23
24
	float process(int enchantmentLevel, RandomSource random, float inputValue);
25
26
	MapCodec<? extends EnchantmentValueEffect> codec();
27
}
28

Decompiled Minecraft 26.3 source of EnchantmentValueEffect (net/minecraft/world/item/enchantment/effects/EnchantmentValueEffect.java) with Mojang official mappings, stored verbatim on the site.