public class EntityList
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
EntityList.EntityEggInfo |
Modifier and Type | Field and Description |
---|---|
static java.util.Map<ResourceLocation,EntityList.EntityEggInfo> |
ENTITY_EGGS
This is a HashMap of the Creative Entity Eggs/Spawners.
|
static ResourceLocation |
LIGHTNING_BOLT |
Constructor and Description |
---|
EntityList() |
Modifier and Type | Method and Description |
---|---|
protected static EntityList.EntityEggInfo |
addSpawnInfo(java.lang.String id,
int primaryColor,
int secondaryColor) |
static Entity |
createEntityByID(int entityID,
World worldIn)
Creates a new entity with the given numeric networked entity type ID in the given world.
|
static Entity |
createEntityByIDFromName(ResourceLocation name,
World worldIn)
Creates a new entity of the given type in the given world.
|
static Entity |
createEntityFromNBT(NBTTagCompound nbt,
World worldIn)
Creates a new entity from the given NBT data in the given world.
|
static java.lang.Class<? extends Entity> |
getClass(ResourceLocation key) |
static java.lang.Class<? extends Entity> |
getClassFromID(int entityID) |
static java.lang.Class<? extends Entity> |
getClassFromName(java.lang.String p_192839_0_) |
static java.util.Set<ResourceLocation> |
getEntityNameList()
Gets a collection of all known entity types.
|
static java.lang.String |
getEntityString(Entity entityIn)
Gets the original name for the entity, used in versions prior to 1.11.
|
static int |
getID(java.lang.Class<? extends Entity> cls) |
static ResourceLocation |
getKey(java.lang.Class<? extends Entity> entityIn)
Gets the
ResourceLocation that identifies the given entity's type. |
static ResourceLocation |
getKey(Entity entityIn)
Gets the
ResourceLocation that identifies the given entity's type. |
static java.lang.String |
getTranslationName(ResourceLocation entityType)
Gets the original name for the given entity type, used in versions prior to 1.11.
|
static java.lang.String |
getValidTypeNames() |
static void |
init() |
static boolean |
isMatchingName(Entity entityIn,
ResourceLocation entityName)
Checks if the given entity type matches the type of that entity, correctly handling behavior of players and
lightning bolts.
|
static boolean |
isRegistered(ResourceLocation entityName)
Checks if the given resource location matches a registered entity type, correctly handling behavior of players
and lightning bols.
|
static Entity |
newEntity(java.lang.Class<? extends Entity> clazz,
World worldIn)
Creates a new entity of the given type in the given world.
|
public static final ResourceLocation LIGHTNING_BOLT
public static final java.util.Map<ResourceLocation,EntityList.EntityEggInfo> ENTITY_EGGS
public static ResourceLocation getKey(Entity entityIn)
ResourceLocation
that identifies the given entity's type.public static ResourceLocation getKey(java.lang.Class<? extends Entity> entityIn)
ResourceLocation
that identifies the given entity's type.#REGISTRY
does not contain a mapping for that class.public static java.lang.String getEntityString(Entity entityIn)
public static java.lang.String getTranslationName(ResourceLocation entityType)
This name is also used for translation strings; translate "entity.$oldid.name"
(with
$oldid being the result of this method) to get those names. Note that the name is upper-case in most
situations.
public static java.lang.Class<? extends Entity> getClassFromID(int entityID)
public static java.lang.Class<? extends Entity> getClassFromName(java.lang.String p_192839_0_)
public static int getID(java.lang.Class<? extends Entity> cls)
public static java.lang.Class<? extends Entity> getClass(ResourceLocation key)
public static Entity newEntity(java.lang.Class<? extends Entity> clazz, World worldIn)
public static Entity createEntityByID(int entityID, World worldIn)
public static Entity createEntityByIDFromName(ResourceLocation name, World worldIn)
public static Entity createEntityFromNBT(NBTTagCompound nbt, World worldIn)
If the entity fails to create, null will be returned and a warning will be logged.
public static java.util.Set<ResourceLocation> getEntityNameList()
public static boolean isMatchingName(Entity entityIn, ResourceLocation entityName)
public static boolean isRegistered(ResourceLocation entityName)
public static java.lang.String getValidTypeNames()
public static void init()
protected static EntityList.EntityEggInfo addSpawnInfo(java.lang.String id, int primaryColor, int secondaryColor)