EnchantmentTarget .java

net.minecraft.world.item.enchantment.EnchantmentTarget (enum): members: ATTACKER, DAMAGING_ENTITY, VICTIM, NON_DAMAGE_CODEC, getSerializedName, CODEC.

net.minecraft.world.item.enchantmentenum24 linescommon688 B

Implements

API Surface (1)

String getSerializedName()

Fields & Constants (3)

CODEC
NON_DAMAGE_CODEC
id

String literals (3)

"attacker"
"damaging_entity"
"victim"

Code Graph: Dependencies (1)

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

Full Source

EnchantmentTarget.java24 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.item.enchantment;
2
3
import com.mojang.serialization.Codec;
4
import net.minecraft.util.StringRepresentable;
5
6
public enum EnchantmentTarget implements StringRepresentable {
7
	ATTACKER("attacker"),
8
	DAMAGING_ENTITY("damaging_entity"),
9
	VICTIM("victim");
10
11
	public static final Codec<EnchantmentTarget> CODEC = StringRepresentable.fromEnum(EnchantmentTarget::values);
12
	public static final Codec<EnchantmentTarget> NON_DAMAGE_CODEC = StringRepresentable.fromEnum(() -> new EnchantmentTarget[]{ATTACKER, VICTIM});
13
	private final String id;
14
15
	EnchantmentTarget(final String id) {
16
		this.id = id;
17
	}
18
19
	@Override
20
	public String getSerializedName() {
21
		return this.id;
22
	}
23
}
24

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