Package net.minecraft.entity
Class EntityType<T extends Entity>
java.lang.Object
net.minecraft.entity.EntityType<T>
- All Implemented Interfaces:
class_5575<Entity,T>
public class EntityType<T extends Entity> extends Object implements class_5575<Entity,T>
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEntityType.Builder<T extends Entity>static interfaceEntityType.EntityFactory<T extends Entity> -
Field Summary
-
Constructor Summary
Constructors Constructor Description EntityType(EntityType.EntityFactory<T> factory, SpawnGroup spawnGroup, boolean saveable, boolean summonable, boolean fireImmune, boolean spawnableFarFromPlayer, ImmutableSet<Block> immutableSet, EntityDimensions entityDimensions, int int2, int int3) -
Method Summary
Modifier and Type Method Description booleanalwaysUpdateVelocity()Tcreate(ServerWorld serverWorld, CompoundTag itemTag, Text name, PlayerEntity player, BlockPos pos, SpawnReason spawnReason, boolean alignPosition, boolean invertY)Tcreate(World world)static EntitycreateInstanceFromId(int type, World world)BoxcreateSimpleBoundingBox(double feetX, double feetY, double feetZ)static Optional<EntityType<?>>fromTag(CompoundTag compoundTag)static Optional<EntityType<?>>get(String id)EntityDimensionsgetDimensions()static Optional<Entity>getEntityFromTag(CompoundTag tag, World world)floatgetHeight()static IdentifiergetId(EntityType<?> type)IdentifiergetLootTableId()intgetMaxTrackDistance()Returns the tracking distance, in chunks, of this type of entity for clients.TextgetName()protected static doublegetOriginY(WorldView world, BlockPos pos, boolean invertY, Box boundingBox)SpawnGroupgetSpawnGroup()intgetTrackTickInterval()StringgetTranslationKey()floatgetWidth()booleanisFireImmune()booleanisIn(Tag<EntityType<?>> tag)booleanisInvalidSpawn(BlockState blockState)Returns whether the EntityType can spawn inside the given block.booleanisSaveable()booleanisSpawnableFarFromPlayer()booleanisSummonable()private static Optional<Entity>loadEntityFromTag(CompoundTag compoundTag, World world)static EntityloadEntityWithPassengers(CompoundTag compoundTag, World world, Function<Entity,Entity> entityProcessor)static voidloadFromEntityTag(World world, PlayerEntity player, Entity entity, CompoundTag itemTag)static Stream<Entity>method_31489(List<? extends Tag> list, World world)Class<? extends Entity>method_31794()Tmethod_31796(Entity entity)private static EntitynewInstance(World world, EntityType<?> type)private static <T extends Entity>
EntityType<T>register(String id, EntityType.Builder<T> type)Tspawn(ServerWorld serverWorld, CompoundTag itemTag, Text name, PlayerEntity player, BlockPos pos, SpawnReason spawnReason, boolean alignPosition, boolean invertY)EntityspawnFromItemStack(ServerWorld serverWorld, ItemStack stack, PlayerEntity player, BlockPos pos, SpawnReason spawnReason, boolean alignPosition, boolean invertY)StringtoString()
-
Field Details
-
LOGGER
-
AREA_EFFECT_CLOUD
-
ARMOR_STAND
-
ARROW
-
AXOLOTL
-
BAT
-
BEE
-
BLAZE
-
BOAT
-
CAT
-
CAVE_SPIDER
-
CHICKEN
-
COD
-
COW
-
CREEPER
-
DOLPHIN
-
DONKEY
-
DRAGON_FIREBALL
-
DROWNED
-
ELDER_GUARDIAN
-
END_CRYSTAL
-
ENDER_DRAGON
-
ENDERMAN
-
ENDERMITE
-
EVOKER
-
EVOKER_FANGS
-
EXPERIENCE_ORB
-
EYE_OF_ENDER
-
FALLING_BLOCK
-
FIREWORK_ROCKET
-
FOX
-
GHAST
-
GIANT
-
GUARDIAN
-
HOGLIN
-
HORSE
-
HUSK
-
ILLUSIONER
-
IRON_GOLEM
-
ITEM
-
ITEM_FRAME
-
FIREBALL
-
LEASH_KNOT
-
LIGHTNING_BOLT
-
LLAMA
-
LLAMA_SPIT
-
MAGMA_CUBE
-
MINECART
-
CHEST_MINECART
-
COMMAND_BLOCK_MINECART
-
FURNACE_MINECART
-
HOPPER_MINECART
-
SPAWNER_MINECART
-
TNT_MINECART
-
MULE
-
MOOSHROOM
-
OCELOT
-
PAINTING
-
PANDA
-
PARROT
-
PHANTOM
-
PIG
-
PIGLIN
-
PIGLIN_BRUTE
-
PILLAGER
-
POLAR_BEAR
-
TNT
-
PUFFERFISH
-
RABBIT
-
RAVAGER
-
SALMON
-
SHEEP
-
SHULKER
-
SHULKER_BULLET
-
SILVERFISH
-
SKELETON
-
SKELETON_HORSE
-
SLIME
-
SMALL_FIREBALL
-
SNOW_GOLEM
-
SNOWBALL
-
SPECTRAL_ARROW
-
SPIDER
-
SQUID
-
STRAY
-
STRIDER
-
EGG
-
ENDER_PEARL
-
EXPERIENCE_BOTTLE
-
POTION
-
TRIDENT
-
TRADER_LLAMA
-
TROPICAL_FISH
-
TURTLE
-
VEX
-
VILLAGER
-
VINDICATOR
-
WANDERING_TRADER
-
WITCH
-
WITHER
-
WITHER_SKELETON
-
WITHER_SKULL
-
WOLF
-
ZOGLIN
-
ZOMBIE
-
ZOMBIE_HORSE
-
ZOMBIE_VILLAGER
-
ZOMBIFIED_PIGLIN
-
PLAYER
-
FISHING_BOBBER
-
factory
-
spawnGroup
-
canSpawnInside
-
saveable
private final boolean saveable -
summonable
private final boolean summonable -
fireImmune
private final boolean fireImmune -
spawnableFarFromPlayer
private final boolean spawnableFarFromPlayer -
maxTrackDistance
private final int maxTrackDistance -
trackTickInterval
private final int trackTickInterval -
translationKey
-
name
-
lootTableId
-
dimensions
-
-
Constructor Details
-
EntityType
public EntityType(EntityType.EntityFactory<T> factory, SpawnGroup spawnGroup, boolean saveable, boolean summonable, boolean fireImmune, boolean spawnableFarFromPlayer, ImmutableSet<Block> immutableSet, EntityDimensions entityDimensions, int int2, int int3)
-
-
Method Details
-
register
-
getId
-
get
-
spawnFromItemStack
@Nullable public Entity spawnFromItemStack(ServerWorld serverWorld, @Nullable ItemStack stack, @Nullable PlayerEntity player, BlockPos pos, SpawnReason spawnReason, boolean alignPosition, boolean invertY) -
spawn
@Nullable public T spawn(ServerWorld serverWorld, @Nullable CompoundTag itemTag, @Nullable Text name, @Nullable PlayerEntity player, BlockPos pos, SpawnReason spawnReason, boolean alignPosition, boolean invertY) -
create
@Nullable public T create(ServerWorld serverWorld, @Nullable CompoundTag itemTag, @Nullable Text name, @Nullable PlayerEntity player, BlockPos pos, SpawnReason spawnReason, boolean alignPosition, boolean invertY) -
getOriginY
-
loadFromEntityTag
public static void loadFromEntityTag(World world, @Nullable PlayerEntity player, @Nullable Entity entity, @Nullable CompoundTag itemTag) -
isSaveable
public boolean isSaveable() -
isSummonable
public boolean isSummonable() -
isFireImmune
public boolean isFireImmune() -
isSpawnableFarFromPlayer
public boolean isSpawnableFarFromPlayer() -
getSpawnGroup
-
getTranslationKey
-
getName
-
toString
-
getLootTableId
-
getWidth
public float getWidth() -
getHeight
public float getHeight() -
create
-
createInstanceFromId
-
getEntityFromTag
-
newInstance
@Environment(CLIENT) @Nullable private static Entity newInstance(World world, @Nullable EntityType<?> type) -
createSimpleBoundingBox
-
isInvalidSpawn
Returns whether the EntityType can spawn inside the given block.By default, non-fire-immune mobs can't spawn in/on blocks dealing fire damage. Any mob can't spawn in wither roses, sweet berry bush, or cacti.
This can be overwritten via
EntityType.Builder.allowSpawningInside(Block[]) -
getDimensions
-
fromTag
-
loadEntityWithPassengers
-
method_31489
-
loadEntityFromTag
-
getMaxTrackDistance
public int getMaxTrackDistance()Returns the tracking distance, in chunks, of this type of entity for clients. This will be then modified by the server's tracking distance multiplier. -
getTrackTickInterval
public int getTrackTickInterval() -
alwaysUpdateVelocity
public boolean alwaysUpdateVelocity() -
isIn
-
method_31796
- Specified by:
method_31796in interfaceclass_5575<Entity,T extends Entity>
-
method_31794
- Specified by:
method_31794in interfaceclass_5575<Entity,T extends Entity>
-