枚举 SpawnGroup
- java.lang.Object
-
- java.lang.Enum<SpawnGroup>
-
- net.minecraft.entity.SpawnGroup
-
- 所有已实现的接口:
Serializable,Comparable<SpawnGroup>,StringIdentifiable
public enum SpawnGroup extends Enum<SpawnGroup> implements StringIdentifiable
A spawn group represents the category of an entity's natural spawning.Entities that don't support natural spawning belong to the
MISCgroup.- 另请参阅:
EntityType.getSpawnGroup(),SpawnHelper- Mappings:
Namespace Name official ataintermediary net/minecraft/class_1311named net/minecraft/entity/SpawnGroup
-
-
枚举常量概要
枚举常量 枚举常量 说明 AMBIENTCREATUREMISCMONSTERUNDERGROUND_WATER_CREATUREWATER_AMBIENTWATER_CREATURE
-
字段概要
字段 修饰符和类型 字段 说明 private static Map<String,SpawnGroup>BY_NAMEprivate intcapacitystatic com.mojang.serialization.Codec<SpawnGroup>CODECA codec that encodes and decodes a spawn group from and to its name string.private intdespawnStartRangeprivate intimmediateDespawnRangeprivate Stringnameprivate booleanpeacefulprivate booleanrare
-
构造器概要
构造器 限定符 构造器 说明 privateSpawnGroup(String name, int spawnCap, boolean peaceful, boolean rare, int immediateDespawnRange)
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 StringasString()static SpawnGroupbyName(String name)Finds the spawn group with the givenname, ornullif no group has the givenname.intgetCapacity()Returns the maximum number of mobs in this group that can be spawned per chunk.intgetDespawnStartRange()Returns the distance, of a mob of this group from a player, at which that mob can despawn at chance.intgetImmediateDespawnRange()Returns the distance, of a mob of this group from a player, at which that mob will despawn immediately.StringgetName()Returns the name of this spawn group.booleanisPeaceful()Returnstrueif this group is spawned as animals, orfalseif this group is spawned as monsters.booleanisRare()Returns if this spawn group is spawned only rarely.static SpawnGroupvalueOf(String name)返回带有指定名称的该类型的枚举常量。static SpawnGroup[]values()按照声明该枚举类型的常量的顺序, 返回 包含这些常量的数组。
-
-
-
枚举常量详细资料
-
MONSTER
public static final SpawnGroup MONSTER
- Mappings:
Namespace Name Mixin selector official aLata;a:Lata;intermediary field_6302Lnet/minecraft/class_1311;field_6302:Lnet/minecraft/class_1311;named MONSTERLnet/minecraft/entity/SpawnGroup;MONSTER:Lnet/minecraft/entity/SpawnGroup;
-
CREATURE
public static final SpawnGroup CREATURE
- Mappings:
Namespace Name Mixin selector official bLata;b:Lata;intermediary field_6294Lnet/minecraft/class_1311;field_6294:Lnet/minecraft/class_1311;named CREATURELnet/minecraft/entity/SpawnGroup;CREATURE:Lnet/minecraft/entity/SpawnGroup;
-
AMBIENT
public static final SpawnGroup AMBIENT
- Mappings:
Namespace Name Mixin selector official cLata;c:Lata;intermediary field_6303Lnet/minecraft/class_1311;field_6303:Lnet/minecraft/class_1311;named AMBIENTLnet/minecraft/entity/SpawnGroup;AMBIENT:Lnet/minecraft/entity/SpawnGroup;
-
UNDERGROUND_WATER_CREATURE
public static final SpawnGroup UNDERGROUND_WATER_CREATURE
- Mappings:
Namespace Name Mixin selector official dLata;d:Lata;intermediary field_30092Lnet/minecraft/class_1311;field_30092:Lnet/minecraft/class_1311;named UNDERGROUND_WATER_CREATURELnet/minecraft/entity/SpawnGroup;UNDERGROUND_WATER_CREATURE:Lnet/minecraft/entity/SpawnGroup;
-
WATER_CREATURE
public static final SpawnGroup WATER_CREATURE
- Mappings:
Namespace Name Mixin selector official eLata;e:Lata;intermediary field_6300Lnet/minecraft/class_1311;field_6300:Lnet/minecraft/class_1311;named WATER_CREATURELnet/minecraft/entity/SpawnGroup;WATER_CREATURE:Lnet/minecraft/entity/SpawnGroup;
-
WATER_AMBIENT
public static final SpawnGroup WATER_AMBIENT
- Mappings:
Namespace Name Mixin selector official fLata;f:Lata;intermediary field_24460Lnet/minecraft/class_1311;field_24460:Lnet/minecraft/class_1311;named WATER_AMBIENTLnet/minecraft/entity/SpawnGroup;WATER_AMBIENT:Lnet/minecraft/entity/SpawnGroup;
-
MISC
public static final SpawnGroup MISC
- Mappings:
Namespace Name Mixin selector official gLata;g:Lata;intermediary field_17715Lnet/minecraft/class_1311;field_17715:Lnet/minecraft/class_1311;named MISCLnet/minecraft/entity/SpawnGroup;MISC:Lnet/minecraft/entity/SpawnGroup;
-
-
字段详细资料
-
CODEC
public static final com.mojang.serialization.Codec<SpawnGroup> CODEC
A codec that encodes and decodes a spawn group from and to its name string.- Mappings:
Namespace Name Mixin selector official hLata;h:Lcom/mojang/serialization/Codec;intermediary field_24655Lnet/minecraft/class_1311;field_24655:Lcom/mojang/serialization/Codec;named CODECLnet/minecraft/entity/SpawnGroup;CODEC:Lcom/mojang/serialization/Codec;
-
BY_NAME
private static final Map<String,SpawnGroup> BY_NAME
- Mappings:
Namespace Name Mixin selector official iLata;i:Ljava/util/Map;intermediary field_6296Lnet/minecraft/class_1311;field_6296:Ljava/util/Map;named BY_NAMELnet/minecraft/entity/SpawnGroup;BY_NAME:Ljava/util/Map;
-
capacity
private final int capacity
- Mappings:
Namespace Name Mixin selector official jLata;j:Iintermediary field_6297Lnet/minecraft/class_1311;field_6297:Inamed capacityLnet/minecraft/entity/SpawnGroup;capacity:I
-
peaceful
private final boolean peaceful
- Mappings:
Namespace Name Mixin selector official kLata;k:Zintermediary field_6298Lnet/minecraft/class_1311;field_6298:Znamed peacefulLnet/minecraft/entity/SpawnGroup;peaceful:Z
-
rare
private final boolean rare
- Mappings:
Namespace Name Mixin selector official lLata;l:Zintermediary field_6295Lnet/minecraft/class_1311;field_6295:Znamed rareLnet/minecraft/entity/SpawnGroup;rare:Z
-
name
private final String name
- Mappings:
Namespace Name Mixin selector official mLata;m:Ljava/lang/String;intermediary field_6304Lnet/minecraft/class_1311;field_6304:Ljava/lang/String;named nameLnet/minecraft/entity/SpawnGroup;name:Ljava/lang/String;
-
despawnStartRange
private final int despawnStartRange
- 另请参阅:
- 常量字段值
- Mappings:
Namespace Name Mixin selector official nLata;n:Iintermediary field_24461Lnet/minecraft/class_1311;field_24461:Inamed despawnStartRangeLnet/minecraft/entity/SpawnGroup;despawnStartRange:I
-
immediateDespawnRange
private final int immediateDespawnRange
- Mappings:
Namespace Name Mixin selector official oLata;o:Iintermediary field_24462Lnet/minecraft/class_1311;field_24462:Inamed immediateDespawnRangeLnet/minecraft/entity/SpawnGroup;immediateDespawnRange:I
-
-
构造器详细资料
-
SpawnGroup
private SpawnGroup(String name, int spawnCap, boolean peaceful, boolean rare, int immediateDespawnRange)
- Mappings:
Namespace Name Mixin selector official <init>Lata;<init>(Ljava/lang/String;ILjava/lang/String;IZZI)Vintermediary <init>Lnet/minecraft/class_1311;<init>(Ljava/lang/String;ILjava/lang/String;IZZI)Vnamed <init>Lnet/minecraft/entity/SpawnGroup;<init>(Ljava/lang/String;ILjava/lang/String;IZZI)V
-
-
方法详细资料
-
values
public static SpawnGroup[] values()
按照声明该枚举类型的常量的顺序, 返回 包含这些常量的数组。该方法可用于迭代 常量, 如下所示:for (SpawnGroup c : SpawnGroup.values()) System.out.println(c);
- 返回:
- 按照声明该枚举类型的常量的顺序返回的包含这些常量的数组
-
valueOf
public static SpawnGroup valueOf(String name)
返回带有指定名称的该类型的枚举常量。 字符串必须与用于声明该类型的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)- 参数:
name- 要返回的枚举常量的名称。- 返回:
- 返回带有指定名称的枚举常量
- 抛出:
IllegalArgumentException- 如果该枚举类型没有带有指定名称的常量NullPointerException- 如果参数为空值
-
getName
public String getName()
Returns the name of this spawn group.The names are unique and are in
lower_snake_case.- Mappings:
Namespace Name Mixin selector official aLata;a()Ljava/lang/String;intermediary method_6133Lnet/minecraft/class_1311;method_6133()Ljava/lang/String;named getNameLnet/minecraft/entity/SpawnGroup;getName()Ljava/lang/String;
-
asString
public String asString()
- 指定者:
asString在接口中StringIdentifiable- Mappings:
Namespace Name Mixin selector official cLagz;c()Ljava/lang/String;intermediary method_15434Lnet/minecraft/class_3542;method_15434()Ljava/lang/String;named asStringLnet/minecraft/util/StringIdentifiable;asString()Ljava/lang/String;
-
byName
public static SpawnGroup byName(String name)
Finds the spawn group with the givenname, ornullif no group has the givenname.- 参数:
name- the name of the group- 返回:
- the found group, or
null - 另请参阅:
getName()- Mappings:
Namespace Name Mixin selector official aLata;a(Ljava/lang/String;)Lata;intermediary method_28307Lnet/minecraft/class_1311;method_28307(Ljava/lang/String;)Lnet/minecraft/class_1311;named byNameLnet/minecraft/entity/SpawnGroup;byName(Ljava/lang/String;)Lnet/minecraft/entity/SpawnGroup;
-
getCapacity
public int getCapacity()
Returns the maximum number of mobs in this group that can be spawned per chunk.- Mappings:
Namespace Name Mixin selector official bLata;b()Iintermediary method_6134Lnet/minecraft/class_1311;method_6134()Inamed getCapacityLnet/minecraft/entity/SpawnGroup;getCapacity()I
-
isPeaceful
public boolean isPeaceful()
Returnstrueif this group is spawned as animals, orfalseif this group is spawned as monsters.- 另请参阅:
World.setMobSpawnOptions(boolean, boolean)- Mappings:
Namespace Name Mixin selector official dLata;d()Zintermediary method_6136Lnet/minecraft/class_1311;method_6136()Znamed isPeacefulLnet/minecraft/entity/SpawnGroup;isPeaceful()Z
-
isRare
public boolean isRare()
Returns if this spawn group is spawned only rarely.A rare spawn only happens when the world time is a multiple of
400inServerChunkManager.tickChunks().- Mappings:
Namespace Name Mixin selector official eLata;e()Zintermediary method_6135Lnet/minecraft/class_1311;method_6135()Znamed isRareLnet/minecraft/entity/SpawnGroup;isRare()Z
-
getImmediateDespawnRange
public int getImmediateDespawnRange()
Returns the distance, of a mob of this group from a player, at which that mob will despawn immediately.This is ignored if a mob cannot immediately despawn.
- 另请参阅:
MobEntity.checkDespawn()- Mappings:
Namespace Name Mixin selector official fLata;f()Iintermediary method_27919Lnet/minecraft/class_1311;method_27919()Inamed getImmediateDespawnRangeLnet/minecraft/entity/SpawnGroup;getImmediateDespawnRange()I
-
getDespawnStartRange
public int getDespawnStartRange()
Returns the distance, of a mob of this group from a player, at which that mob can despawn at chance.This is ignored if a mob cannot immediately despawn.
- 另请参阅:
MobEntity.checkDespawn()- Mappings:
Namespace Name Mixin selector official gLata;g()Iintermediary method_27920Lnet/minecraft/class_1311;method_27920()Inamed getDespawnStartRangeLnet/minecraft/entity/SpawnGroup;getDespawnStartRange()I
-
-