MobCategory .java

net.minecraft.world.entity.MobCategory (enum, 67 lines): members: MONSTER, CREATURE, AMBIENT, AXOLOTLS, UNDERGROUND_WATER_CREATURE, WATER_CREATURE, MISC.

net.minecraft.world.entityenum67 linescommon1.8 KB

Implements

API Surface (8)

String getName()
String getDebugAbbreviation()
String getSerializedName()
int getMaxInstancesPerChunk()
boolean isFriendly()
boolean isPersistent()
int getDespawnDistance()
int getNoDespawnDistance()

Fields & Constants (8)

CODEC
max
isFriendly
isPersistent
name
debugAbbreviation
noDespawnDistance
despawnDistance

String literals (8)

"monster"
"creature"
"ambient"
"axolotls"
"underground_water_creature"
"water_creature"
"water_ambient"
"misc"

Code Graph: Dependencies (1)

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

Full Source

MobCategory.java67 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.entity;
2
3
import com.mojang.serialization.Codec;
4
import net.minecraft.util.StringRepresentable;
5
6
public enum MobCategory implements StringRepresentable {
7
	MONSTER("monster", "MO", 70, false, false, 128),
8
	CREATURE("creature", "C", 10, true, true, 128),
9
	AMBIENT("ambient", "AM", 15, true, false, 128),
10
	AXOLOTLS("axolotls", "AX", 5, true, false, 128),
11
	UNDERGROUND_WATER_CREATURE("underground_water_creature", "UWC", 5, true, false, 128),
12
	WATER_CREATURE("water_creature", "WC", 5, true, false, 128),
13
	WATER_AMBIENT("water_ambient", "WA", 20, true, false, 64),
14
	MISC("misc", "MI", -1, true, true, 128);
15
16
	public static final Codec<MobCategory> CODEC = StringRepresentable.fromEnum(MobCategory::values);
17
	private final int max;
18
	private final boolean isFriendly;
19
	private final boolean isPersistent;
20
	private final String name;
21
	private final String debugAbbreviation;
22
	private final int noDespawnDistance = 32;
23
	private final int despawnDistance;
24
25
	MobCategory(final String name, final String debugAbbreviation, final int max, final boolean isFriendly, final boolean isPersistent, final int despawnDistance) {
26
		this.name = name;
27
		this.debugAbbreviation = debugAbbreviation;
28
		this.max = max;
29
		this.isFriendly = isFriendly;
30
		this.isPersistent = isPersistent;
31
		this.despawnDistance = despawnDistance;
32
	}
33
34
	public String getName() {
35
		return this.name;
36
	}
37
38
	public String getDebugAbbreviation() {
39
		return this.debugAbbreviation;
40
	}
41
42
	@Override
43
	public String getSerializedName() {
44
		return this.name;
45
	}
46
47
	public int getMaxInstancesPerChunk() {
48
		return this.max;
49
	}
50
51
	public boolean isFriendly() {
52
		return this.isFriendly;
53
	}
54
55
	public boolean isPersistent() {
56
		return this.isPersistent;
57
	}
58
59
	public int getDespawnDistance() {
60
		return this.despawnDistance;
61
	}
62
63
	public int getNoDespawnDistance() {
64
		return 32;
65
	}
66
}
67

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