net.minecraft.entity

public class EntityType<T extends Entity>

implements TypeFilter<Entity, T>, ToggleableFeature

net.minecraft.world.entity.EntityType
net.minecraft.world.entity.EntityType
net.minecraft.class_1299
net.minecraft.entity.EntityType

Field summary

Modifier and TypeField
private static final org.slf4j.Logger
LOGGER
LOGGER
field_6088
LOGGER
private final RegistryEntry$Reference<EntityType<?>>
builtInRegistryHolder
builtInRegistryHolder
field_36398
registryEntry
public static final com.mojang.serialization.Codec<EntityType<?>>
CODEC
CODEC
field_57582
CODEC
public static final PacketCodec<RegistryByteBuf, EntityType<?>>
STREAM_CODEC
STREAM_CODEC
field_61222
PACKET_CODEC
private final EntityType$EntityFactory<T>
factory
factory
field_6101
factory
private final SpawnGroup
category
category
field_6094
spawnGroup
private final TagKey<Block>
immuneTo
immuneTo
field_25355
canSpawnInside
private final boolean
serialize
serialize
field_6056
saveable
private final boolean
summon
summon
field_6072
summonable
private final boolean
fireImmune
fireImmune
field_18981
fireImmune
private final boolean
canSpawnFarFromPlayer
canSpawnFarFromPlayer
field_19423
spawnableFarFromPlayer
private final int
clientTrackingRange
clientTrackingRange
field_24085
maxTrackDistance
private final int
updateInterval
updateInterval
field_24086
trackTickInterval
private final String
descriptionId
descriptionId
field_6106
translationKey
private Text
description
description
field_6092
name
private final Optional<RegistryKey<LootTable>>
lootTable
lootTable
field_16526
lootTableKey
private final EntityDimensions
dimensions
dimensions
field_18070
dimensions
private final float
spawnDimensionsScale
spawnDimensionsScale
field_50125
spawnBoxScale
private final FeatureSet
requiredFeatures
requiredFeatures
field_40115
requiredFeatures
private final boolean
allowedInPeaceful
allowedInPeaceful
field_61223
allowedInPeaceful

Constructor summary

ModifierConstructor
public (EntityType$EntityFactory<T> factory, SpawnGroup spawnGroup, boolean saveable, boolean summonable, boolean fireImmune, boolean spawnableFarFromPlayer, TagKey<Block> canSpawnInside, EntityDimensions dimensions, float spawnBoxScale, int maxTrackDistance, int trackTickInterval, String translationKey, Optional<RegistryKey<LootTable>> lootTable, FeatureSet requiredFeatures, boolean allowedInPeaceful)

Method summary

Modifier and TypeMethod
public static Identifier
getKey(EntityType<?> type)
getKey(EntityType<?> type)
method_5890(class_1299<?> arg0)
getId(EntityType<?> type)
public T
spawn(ServerLevel level, ItemStack itemStack, LivingEntity user, BlockPos spawnPos, EntitySpawnReason spawnReason, boolean tryMoveDown, boolean movedUp)
spawn(ServerLevel level, ItemStack itemStack, LivingEntity user, BlockPos spawnPos, EntitySpawnReason spawnReason, boolean tryMoveDown, boolean movedUp)
method_5894(class_3218 arg0, class_1799 arg1, class_1309 arg2, class_2338 arg3, class_3730 arg4, boolean arg5, boolean arg6)
spawnFromItemStack(ServerWorld world, ItemStack stack, LivingEntity spawner, BlockPos pos, SpawnReason spawnReason, boolean alignPosition, boolean invertY)
public static <T extends Entity> EntityInitializer<T>
createDefaultStackConfig(Level level, ItemStack itemStack, LivingEntity user)
createDefaultStackConfig(Level level, ItemStack itemStack, LivingEntity user)
method_48009(class_1937 arg0, class_1799 arg1, class_1309 arg2)
copier(World world, ItemStack stack, LivingEntity spawner)
public static <T extends Entity> EntityInitializer<T>
appendDefaultStackConfig(PostSpawnProcessor<T> initialConfig, Level level, ItemStack itemStack, LivingEntity user)
appendDefaultStackConfig(PostSpawnProcessor<T> initialConfig, Level level, ItemStack itemStack, LivingEntity user)
method_48156(class_1_1033<T> arg0, class_1937 arg1, class_1799 arg2, class_1309 arg3)
copier(EntityInitializer<T> before, World world, ItemStack stack, LivingEntity spawner)
public static <T extends Entity> EntityInitializer<T>
appendComponentsConfig(PostSpawnProcessor<T> initialConfig, ItemStack itemStack)
appendComponentsConfig(PostSpawnProcessor<T> initialConfig, ItemStack itemStack)
method_66663(class_1_1033<T> arg0, class_1799 arg1)
componentsCopier(EntityInitializer<T> before, ItemStack stack)
public static <T extends Entity> EntityInitializer<T>
appendCustomEntityStackConfig(PostSpawnProcessor<T> initialConfig, Level level, ItemStack itemStack, LivingEntity user)
appendCustomEntityStackConfig(PostSpawnProcessor<T> initialConfig, Level level, ItemStack itemStack, LivingEntity user)
method_48011(class_1_1033<T> arg0, class_1937 arg1, class_1799 arg2, class_1309 arg3)
nbtCopier(EntityInitializer<T> before, World world, ItemStack stack, LivingEntity spawner)
public T
spawn(ServerLevel level, BlockPos spawnPos, EntitySpawnReason spawnReason)
spawn(ServerLevel level, BlockPos spawnPos, EntitySpawnReason spawnReason)
method_47821(class_3218 arg0, class_2338 arg1, class_3730 arg2)
spawn(ServerWorld world, BlockPos pos, SpawnReason reason)
public T
spawn(ServerLevel level, PostSpawnProcessor<T> postSpawnConfig, BlockPos spawnPos, EntitySpawnReason spawnReason, boolean tryMoveDown, boolean movedUp)
spawn(ServerLevel level, PostSpawnProcessor<T> postSpawnConfig, BlockPos spawnPos, EntitySpawnReason spawnReason, boolean tryMoveDown, boolean movedUp)
method_5899(class_3218 arg0, class_1_1033<T> arg1, class_2338 arg2, class_3730 arg3, boolean arg4, boolean arg5)
spawn(ServerWorld world, EntityInitializer<T> initializer, BlockPos pos, SpawnReason reason, boolean alignPosition, boolean invertY)
public T
create(ServerLevel level, PostSpawnProcessor<T> postSpawnConfig, BlockPos spawnPos, EntitySpawnReason spawnReason, boolean tryMoveDown, boolean movedUp)
create(ServerLevel level, PostSpawnProcessor<T> postSpawnConfig, BlockPos spawnPos, EntitySpawnReason spawnReason, boolean tryMoveDown, boolean movedUp)
method_5888(class_3218 arg0, class_1_1033<T> arg1, class_2338 arg2, class_3730 arg3, boolean arg4, boolean arg5)
create(ServerWorld world, EntityInitializer<T> initializer, BlockPos pos, SpawnReason reason, boolean alignPosition, boolean invertY)
protected static double
getYOffset(LevelReader level, BlockPos spawnPos, boolean movedUp, AABB entityBox)
getYOffset(LevelReader level, BlockPos spawnPos, boolean movedUp, AABB entityBox)
method_5884(class_4538 arg0, class_2338 arg1, boolean arg2, class_238 arg3)
getOriginY(WorldView world, BlockPos pos, boolean invertY, Box boundingBox)
public static void
updateCustomEntityTag(Level level, LivingEntity user, Entity entity, TypedEntityData<EntityType<?>> entityData)
updateCustomEntityTag(Level level, LivingEntity user, Entity entity, TypedEntityData<EntityType<?>> entityData)
method_5881(class_1937 arg0, class_1309 arg1, class_1297 arg2, class_11580<class_1299<?>> arg3)
loadFromEntityNbt(World world, LivingEntity spawner, Entity entity, TypedEntityData<EntityType<?>> data)
public boolean
canSerialize()
canSerialize()
method_5893()
isSaveable()
public boolean
canSummon()
canSummon()
method_5896()
isSummonable()
public boolean
fireImmune()
fireImmune()
method_19946()
isFireImmune()
public boolean
canSpawnFarFromPlayer()
canSpawnFarFromPlayer()
method_20814()
isSpawnableFarFromPlayer()
public SpawnGroup
getCategory()
getCategory()
method_5891()
getSpawnGroup()
public String
getDescriptionId()
getDescriptionId()
method_5882()
getTranslationKey()
public Text
getDescription()
getDescription()
method_5897()
getName()
public String
toShortString()
toShortString()
method_35050()
getUntranslatedName()
public Optional<RegistryKey<LootTable>>
getDefaultLootTable()
getDefaultLootTable()
method_16351()
getLootTableKey()
public float
getWidth()
getWidth()
method_17685()
getWidth()
public float
getHeight()
getHeight()
method_17686()
getHeight()
public FeatureSet
requiredFeatures()
requiredFeatures()
method_45322()
getRequiredFeatures()
public boolean
canSpawn(Level level)
canSpawn(Level level)
method_1_5188(class_1937 arg0)
isAllowedInWorld(World world)
public T
create(Level level, EntitySpawnReason reason)
create(Level level, EntitySpawnReason reason)
method_5883(class_1937 arg0, class_3730 arg1)
create(World world, SpawnReason reason)
public T
create(Level level, EntitySpawnRequest request)
create(Level level, EntitySpawnRequest request)
method_1_6355(class_1937 arg0, class_1_1035 arg1)
create(World world, SpawnContext context)
public static Optional<Entity>
create(ValueInput input, Level level, EntitySpawnRequest request)
create(ValueInput input, Level level, EntitySpawnRequest request)
method_5892(class_11368 arg0, class_1937 arg1, class_1_1035 arg2)
getEntityFromData(ReadView view, World world, SpawnContext context)
public static Optional<Entity>
create(EntityType<?> type, ValueInput input, Level level, EntitySpawnReason reason)
create(EntityType<?> type, ValueInput input, Level level, EntitySpawnReason reason)
method_72384(class_1299<?> arg0, class_11368 arg1, class_1937 arg2, class_3730 arg3)
getEntityFromData(EntityType<?> type, ReadView readView, World world, SpawnReason spawnReason)
public Box
getSpawnAABB(double x, double y, double z)
getSpawnAABB(double x, double y, double z)
method_58629(double arg0, double arg1, double arg2)
getSpawnBox(double x, double y, double z)
public boolean
isBlockDangerous(BlockState state)
isBlockDangerous(BlockState state)
method_29496(class_2680 arg0)
isInvalidSpawn(BlockState state)
public EntityDimensions
getDimensions()
getDimensions()
method_18386()
getDimensions()
public static Optional<EntityType<?>>
by(ValueInput input)
by(ValueInput input)
method_17684(class_11368 arg0)
fromData(ReadView view)
public static Entity
loadEntityRecursive(CompoundTag tag, Level level, EntitySpawnRequest request, EntityProcessor postLoad)
loadEntityRecursive(CompoundTag tag, Level level, EntitySpawnRequest request, EntityProcessor postLoad)
method_71371(class_2487 arg0, class_1937 arg1, class_1_1035 arg2, class_12259 arg3)
loadEntityWithPassengers(NbtCompound nbt, World world, SpawnContext context, LoadedEntityProcessor processor)
public static Entity
loadEntityRecursive(EntityType<?> type, CompoundTag tag, Level level, EntitySpawnReason reason, EntityProcessor postLoad)
loadEntityRecursive(EntityType<?> type, CompoundTag tag, Level level, EntitySpawnReason reason, EntityProcessor postLoad)
method_72386(class_1299<?> arg0, class_2487 arg1, class_1937 arg2, class_3730 arg3, class_12259 arg4)
loadEntityWithPassengers(EntityType<?> type, NbtCompound data, World world, SpawnReason reason, LoadedEntityProcessor processor)
public static Entity
loadEntityRecursive(ValueInput input, Level level, EntitySpawnReason reason, EntityProcessor postLoad)
loadEntityRecursive(ValueInput input, Level level, EntitySpawnReason reason, EntityProcessor postLoad)
method_1_6356(class_11368 arg0, class_1937 arg1, class_3730 arg2, class_12259 arg3)
loadEntityWithPassengers(ReadView view, World world, SpawnReason reason, LoadedEntityProcessor entityProcessor)
public static Entity
loadEntityRecursive(ValueInput input, Level level, EntitySpawnRequest request, EntityProcessor postLoad)
loadEntityRecursive(ValueInput input, Level level, EntitySpawnRequest request, EntityProcessor postLoad)
method_17842(class_11368 arg0, class_1937 arg1, class_1_1035 arg2, class_12259 arg3)
loadEntityWithPassengers(ReadView view, World world, SpawnContext context, LoadedEntityProcessor processor)
public static Entity
loadEntityRecursive(EntityType<?> type, ValueInput input, Level level, EntitySpawnReason reason, EntityProcessor postLoad)
loadEntityRecursive(EntityType<?> type, ValueInput input, Level level, EntitySpawnReason reason, EntityProcessor postLoad)
method_72385(class_1299<?> arg0, class_11368 arg1, class_1937 arg2, class_3730 arg3, class_12259 arg4)
loadEntityWithPassengers(EntityType<?> type, ReadView view, World world, SpawnReason reason, LoadedEntityProcessor processor)
private static Entity
loadPassengersRecursive(Entity entity, ValueInput input, Level level, EntitySpawnRequest request, EntityProcessor postLoad)
loadPassengersRecursive(Entity entity, ValueInput input, Level level, EntitySpawnRequest request, EntityProcessor postLoad)
method_72383(class_1297 arg0, class_11368 arg1, class_1937 arg2, class_1_1035 arg3, class_12259 arg4)
loadEntityPassengers(Entity entity, ReadView view, World world, SpawnContext context, LoadedEntityProcessor processor)
public static Stream<Entity>
loadEntitiesRecursive(ValueInput$ValueInputList entities, Level level, EntitySpawnReason reason)
loadEntitiesRecursive(ValueInput$ValueInputList entities, Level level, EntitySpawnReason reason)
method_31489(class_11368$class_11370 arg0, class_1937 arg1, class_3730 arg2)
streamFromData(ReadView$ListReadView view, World world, SpawnReason reason)
private static Optional<Entity>
loadStaticEntity(ValueInput input, Level level, EntitySpawnRequest request)
loadStaticEntity(ValueInput input, Level level, EntitySpawnRequest request)
method_17848(class_11368 arg0, class_1937 arg1, class_1_1035 arg2)
loadEntityFromData(ReadView view, World world, SpawnContext context)
private static Optional<Entity>
loadStaticEntity(EntityType<?> type, ValueInput input, Level level, EntitySpawnReason reason)
loadStaticEntity(EntityType<?> type, ValueInput input, Level level, EntitySpawnReason reason)
method_72389(class_1299<?> arg0, class_11368 arg1, class_1937 arg2, class_3730 arg3)
loadEntityFromData(EntityType<?> type, ReadView view, World world, SpawnReason reason)
public int
clientTrackingRange()
clientTrackingRange()
method_18387()
getMaxTrackDistance()
public int
updateInterval()
updateInterval()
method_18388()
getTrackTickInterval()
public boolean
trackDeltas()
trackDeltas()
method_18389()
alwaysUpdateVelocity()
public T
tryCast(Entity entity)
tryCast(Entity entity)
method_31488(class_1297 arg0)
downcast(Entity arg0)
public Class<? extends Entity>
getBaseClass()
getBaseClass()
method_31794()
getBaseClass()
public RegistryEntry$Reference<EntityType<?>>
builtInRegistryHolder()
builtInRegistryHolder()
method_40124()
getRegistryEntry()
public boolean
isAllowedInPeaceful()
isAllowedInPeaceful()
method_72390()
isAllowedInPeaceful()
public boolean
onlyOpCanSetNbt()
onlyOpCanSetNbt()
method_65893()
canPotentiallyExecuteCommands()