EnchantmentLocationBasedEffect .java

net.minecraft.world.item.enchantment.effects.EnchantmentLocationBasedEffect (interface): members: onDeactivated, onChangedBlock, bootstrap, codec, CODEC.

net.minecraft.world.item.enchantment.effectsinterface44 linescommon2.3 KB

API Surface (0)

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

Fields & Constants (1)

CODEC

String literals (16)

"all_of"
"apply_mob_effect"
"attribute"
"change_item_damage"
"damage_entity"
"explode"
"ignite"
"apply_impulse"
"apply_exhaustion"
"play_sound"
"replace_block"
"replace_disk"
"run_function"
"set_block_properties"
"spawn_particles"
"summon_entity"

Code Graph: Dependencies (6)

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

Full Source

EnchantmentLocationBasedEffect.java44 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.server.level.ServerLevel;
9
import net.minecraft.world.entity.Entity;
10
import net.minecraft.world.item.enchantment.EnchantedItemInUse;
11
import net.minecraft.world.phys.Vec3;
12
13
public interface EnchantmentLocationBasedEffect {
14
	Codec<EnchantmentLocationBasedEffect> CODEC = BuiltInRegistries.ENCHANTMENT_LOCATION_BASED_EFFECT_TYPE
15
		.byNameCodec()
16
		.dispatch(EnchantmentLocationBasedEffect::codec, Function.identity());
17
18
	static MapCodec<? extends EnchantmentLocationBasedEffect> bootstrap(final Registry<MapCodec<? extends EnchantmentLocationBasedEffect>> registry) {
19
		Registry.register(registry, "all_of", AllOf.LocationBasedEffects.CODEC);
20
		Registry.register(registry, "apply_mob_effect", ApplyMobEffect.CODEC);
21
		Registry.register(registry, "attribute", EnchantmentAttributeEffect.MAP_CODEC);
22
		Registry.register(registry, "change_item_damage", ChangeItemDamage.CODEC);
23
		Registry.register(registry, "damage_entity", DamageEntity.CODEC);
24
		Registry.register(registry, "explode", ExplodeEffect.CODEC);
25
		Registry.register(registry, "ignite", Ignite.CODEC);
26
		Registry.register(registry, "apply_impulse", ApplyEntityImpulse.CODEC);
27
		Registry.register(registry, "apply_exhaustion", ApplyExhaustion.CODEC);
28
		Registry.register(registry, "play_sound", PlaySoundEffect.CODEC);
29
		Registry.register(registry, "replace_block", ReplaceBlock.CODEC);
30
		Registry.register(registry, "replace_disk", ReplaceDisk.CODEC);
31
		Registry.register(registry, "run_function", RunFunction.CODEC);
32
		Registry.register(registry, "set_block_properties", SetBlockProperties.CODEC);
33
		Registry.register(registry, "spawn_particles", SpawnParticlesEffect.CODEC);
34
		return Registry.register(registry, "summon_entity", SummonEntityEffect.CODEC);
35
	}
36
37
	void onChangedBlock(ServerLevel serverLevel, int enchantmentLevel, EnchantedItemInUse item, Entity entity, Vec3 position, boolean becameActive);
38
39
	default void onDeactivated(final EnchantedItemInUse item, final Entity entity, final Vec3 position, final int level) {
40
	}
41
42
	MapCodec<? extends EnchantmentLocationBasedEffect> codec();
43
}
44

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