Package net.minecraft.world.entity
Class EntityType<T extends Entity>
java.lang.Object
net.minecraft.world.entity.EntityType<T>
- All Implemented Interfaces:
FeatureElement
,EntityTypeTest<Entity,
T>
public class EntityType<T extends Entity>
extends Object
implements FeatureElement, EntityTypeTest<Entity,T>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
EntityType.Builder<T extends Entity>
static interface
EntityType.EntityFactory<T extends Entity>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EntityType<Allay>
static final EntityType<AreaEffectCloud>
static final EntityType<ArmorStand>
static final EntityType<Arrow>
static final EntityType<Axolotl>
static final EntityType<Bat>
static final EntityType<Bee>
static final EntityType<Blaze>
static final EntityType<Display.BlockDisplay>
static final EntityType<Boat>
private final Holder.Reference<EntityType<?>>
static final EntityType<Camel>
private final boolean
static final EntityType<Cat>
private final MobCategory
static final EntityType<CaveSpider>
static final EntityType<ChestBoat>
static final EntityType<MinecartChest>
static final EntityType<Chicken>
private final int
static final EntityType<Cod>
static final EntityType<MinecartCommandBlock>
static final EntityType<Cow>
static final EntityType<Creeper>
private final BiFunction<PlayMessages.SpawnEntity,
Level, T> private Component
private String
private final EntityDimensions
private static final int
static final EntityType<Dolphin>
static final EntityType<Donkey>
static final EntityType<DragonFireball>
static final EntityType<Drowned>
static final EntityType<ThrownEgg>
static final EntityType<ElderGuardian>
static final EntityType<EndCrystal>
static final EntityType<EnderDragon>
static final EntityType<ThrownEnderpearl>
static final EntityType<EnderMan>
static final EntityType<Endermite>
static final String
static final EntityType<Evoker>
static final EntityType<EvokerFangs>
static final EntityType<ThrownExperienceBottle>
static final EntityType<ExperienceOrb>
static final EntityType<EyeOfEnder>
private final EntityType.EntityFactory<T>
static final EntityType<FallingBlockEntity>
static final EntityType<LargeFireball>
private final boolean
static final EntityType<FireworkRocketEntity>
static final EntityType<FishingHook>
static final EntityType<Fox>
static final EntityType<Frog>
static final EntityType<MinecartFurnace>
static final EntityType<Ghast>
static final EntityType<Giant>
static final EntityType<GlowItemFrame>
static final EntityType<GlowSquid>
static final EntityType<Goat>
static final EntityType<Guardian>
static final EntityType<Hoglin>
static final EntityType<MinecartHopper>
static final EntityType<Horse>
static final EntityType<Husk>
static final EntityType<Illusioner>
private final com.google.common.collect.ImmutableSet<Block>
static final EntityType<Interaction>
static final EntityType<IronGolem>
static final EntityType<ItemEntity>
static final EntityType<Display.ItemDisplay>
static final EntityType<ItemFrame>
static final EntityType<LeashFenceKnotEntity>
static final EntityType<LightningBolt>
static final EntityType<Llama>
static final EntityType<LlamaSpit>
private static final org.slf4j.Logger
private ResourceLocation
private static final float
static final EntityType<MagmaCube>
static final EntityType<Marker>
static final EntityType<Minecart>
static final EntityType<MushroomCow>
static final EntityType<Mule>
static final EntityType<Ocelot>
static final EntityType<Painting>
static final EntityType<Panda>
static final EntityType<Parrot>
static final EntityType<Phantom>
static final EntityType<Pig>
static final EntityType<Piglin>
static final EntityType<PiglinBrute>
static final EntityType<Pillager>
static final EntityType<Player>
static final EntityType<PolarBear>
static final EntityType<ThrownPotion>
static final EntityType<Pufferfish>
static final EntityType<Rabbit>
static final EntityType<Ravager>
private final FeatureFlagSet
static final EntityType<Salmon>
private final boolean
static final EntityType<Sheep>
static final EntityType<Shulker>
static final EntityType<ShulkerBullet>
static final EntityType<Silverfish>
static final EntityType<Skeleton>
static final EntityType<SkeletonHorse>
static final EntityType<Slime>
static final EntityType<SmallFireball>
static final EntityType<Sniffer>
static final EntityType<SnowGolem>
static final EntityType<Snowball>
static final EntityType<MinecartSpawner>
static final EntityType<SpectralArrow>
static final EntityType<Spider>
static final EntityType<Squid>
static final EntityType<Stray>
static final EntityType<Strider>
private final boolean
static final EntityType<Tadpole>
static final EntityType<Display.TextDisplay>
static final EntityType<PrimedTnt>
static final EntityType<MinecartTNT>
private final ToIntFunction<EntityType<?>>
static final EntityType<TraderLlama>
static final EntityType<ThrownTrident>
static final EntityType<TropicalFish>
static final EntityType<Turtle>
private final int
private final ToIntFunction<EntityType<?>>
private final Predicate<EntityType<?>>
static final EntityType<Vex>
static final EntityType<Villager>
static final EntityType<Vindicator>
static final EntityType<WanderingTrader>
static final EntityType<Warden>
static final EntityType<Witch>
static final EntityType<WitherBoss>
static final EntityType<WitherSkeleton>
static final EntityType<WitherSkull>
static final EntityType<Wolf>
static final EntityType<Zoglin>
static final EntityType<Zombie>
static final EntityType<ZombieHorse>
static final EntityType<ZombieVillager>
static final EntityType<ZombifiedPiglin>
Fields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES
-
Constructor Summary
ConstructorsConstructorDescriptionEntityType
(EntityType.EntityFactory<T> p_273268_, MobCategory p_272918_, boolean p_273417_, boolean p_273389_, boolean p_273556_, boolean p_272654_, com.google.common.collect.ImmutableSet<Block> p_273631_, EntityDimensions p_272946_, int p_272895_, int p_273451_, FeatureFlagSet p_273518_) EntityType
(EntityType.EntityFactory<T> p_251402_, MobCategory p_251431_, boolean p_251439_, boolean p_251973_, boolean p_252007_, boolean p_250908_, com.google.common.collect.ImmutableSet<Block> p_250201_, EntityDimensions p_251742_, int p_250479_, int p_249249_, FeatureFlagSet p_250427_, Predicate<EntityType<?>> velocityUpdateSupplier, ToIntFunction<EntityType<?>> trackingRangeSupplier, ToIntFunction<EntityType<?>> updateIntervalSupplier, BiFunction<PlayMessages.SpawnEntity, Level, T> customClientFactory) -
Method Summary
Modifier and TypeMethodDescriptionappendCustomEntityStackConfig
(Consumer<T> p_263579_, ServerLevel p_263571_, ItemStack p_263582_, Player p_263574_) appendCustomNameConfig
(Consumer<T> p_263567_, ItemStack p_263564_) appendDefaultStackConfig
(Consumer<T> p_265154_, ServerLevel p_265733_, ItemStack p_265598_, Player p_265666_) Deprecated.static Optional<EntityType<?>>
by
(CompoundTag p_20638_) static Optional<EntityType<?>>
boolean
boolean
boolean
int
create
(CompoundTag p_20643_, Level p_20644_) create
(ServerLevel p_262637_, CompoundTag p_262687_, Consumer<T> p_262629_, BlockPos p_262595_, MobSpawnType p_262666_, boolean p_262685_, boolean p_262588_) createDefaultStackConfig
(ServerLevel p_263583_, ItemStack p_263568_, Player p_263575_) customClientSpawn
(PlayMessages.SpawnEntity packet, Level world) private int
private int
private boolean
boolean
getAABB
(double p_20586_, double p_20587_, double p_20588_) float
static ResourceLocation
getKey
(EntityType<?> p_20614_) Stream<TagKey<EntityType<?>>>
getTags()
float
getWidth()
protected static double
getYOffset
(LevelReader p_20626_, BlockPos p_20627_, boolean p_20628_, AABB p_20629_) boolean
is
(TagKey<EntityType<?>> p_204040_) boolean
isBlockDangerous
(BlockState p_20631_) loadEntitiesRecursive
(List<? extends Tag> p_147046_, Level p_147047_) static Entity
loadEntityRecursive
(CompoundTag p_20646_, Level p_20647_, Function<Entity, Entity> p_20648_) loadStaticEntity
(CompoundTag p_20670_, Level p_20671_) private static <T extends Entity>
EntityType<T>register
(String p_20635_, EntityType.Builder<T> p_20636_) spawn
(ServerLevel p_262634_, BlockPos p_262707_, MobSpawnType p_262597_) spawn
(ServerLevel p_262704_, CompoundTag p_262603_, Consumer<T> p_262621_, BlockPos p_262672_, MobSpawnType p_262644_, boolean p_262690_, boolean p_262590_) spawn
(ServerLevel p_20593_, ItemStack p_20594_, Player p_20595_, BlockPos p_20596_, MobSpawnType p_20597_, boolean p_20598_, boolean p_20599_) toString()
boolean
static void
updateCustomEntityTag
(Level p_20621_, Player p_20622_, Entity p_20623_, CompoundTag p_20624_) int
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabled
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
ENTITY_TAG
- See Also:
-
builtInRegistryHolder
-
MAGIC_HORSE_WIDTH
private static final float MAGIC_HORSE_WIDTH- See Also:
-
DISPLAY_TRACKING_RANGE
private static final int DISPLAY_TRACKING_RANGE- See Also:
-
ALLAY
-
AREA_EFFECT_CLOUD
-
ARMOR_STAND
-
ARROW
-
AXOLOTL
-
BAT
-
BEE
-
BLAZE
-
BLOCK_DISPLAY
-
BOAT
-
CAMEL
-
CAT
-
CAVE_SPIDER
-
CHEST_BOAT
-
CHEST_MINECART
-
CHICKEN
-
COD
-
COMMAND_BLOCK_MINECART
-
COW
-
CREEPER
-
DOLPHIN
-
DONKEY
-
DRAGON_FIREBALL
-
DROWNED
-
EGG
-
ELDER_GUARDIAN
-
END_CRYSTAL
-
ENDER_DRAGON
-
ENDER_PEARL
-
ENDERMAN
-
ENDERMITE
-
EVOKER
-
EVOKER_FANGS
-
EXPERIENCE_BOTTLE
-
EXPERIENCE_ORB
-
EYE_OF_ENDER
-
FALLING_BLOCK
-
FIREWORK_ROCKET
-
FOX
-
FROG
-
FURNACE_MINECART
-
GHAST
-
GIANT
-
GLOW_ITEM_FRAME
-
GLOW_SQUID
-
GOAT
-
GUARDIAN
-
HOGLIN
-
HOPPER_MINECART
-
HORSE
-
HUSK
-
ILLUSIONER
-
INTERACTION
-
IRON_GOLEM
-
ITEM
-
ITEM_DISPLAY
-
ITEM_FRAME
-
FIREBALL
-
LEASH_KNOT
-
LIGHTNING_BOLT
-
LLAMA
-
LLAMA_SPIT
-
MAGMA_CUBE
-
MARKER
-
MINECART
-
MOOSHROOM
-
MULE
-
OCELOT
-
PAINTING
-
PANDA
-
PARROT
-
PHANTOM
-
PIG
-
PIGLIN
-
PIGLIN_BRUTE
-
PILLAGER
-
POLAR_BEAR
-
POTION
-
PUFFERFISH
-
RABBIT
-
RAVAGER
-
SALMON
-
SHEEP
-
SHULKER
-
SHULKER_BULLET
-
SILVERFISH
-
SKELETON
-
SKELETON_HORSE
-
SLIME
-
SMALL_FIREBALL
-
SNIFFER
-
SNOW_GOLEM
-
SNOWBALL
-
SPAWNER_MINECART
-
SPECTRAL_ARROW
-
SPIDER
-
SQUID
-
STRAY
-
STRIDER
-
TADPOLE
-
TEXT_DISPLAY
-
TNT
-
TNT_MINECART
-
TRADER_LLAMA
-
TRIDENT
-
TROPICAL_FISH
-
TURTLE
-
VEX
-
VILLAGER
-
VINDICATOR
-
WANDERING_TRADER
-
WARDEN
-
WITCH
-
WITHER
-
WITHER_SKELETON
-
WITHER_SKULL
-
WOLF
-
ZOGLIN
-
ZOMBIE
-
ZOMBIE_HORSE
-
ZOMBIE_VILLAGER
-
ZOMBIFIED_PIGLIN
-
PLAYER
-
FISHING_BOBBER
-
factory
-
category
-
immuneTo
-
serialize
private final boolean serialize -
summon
private final boolean summon -
fireImmune
private final boolean fireImmune -
canSpawnFarFromPlayer
private final boolean canSpawnFarFromPlayer -
clientTrackingRange
private final int clientTrackingRange -
updateInterval
private final int updateInterval -
descriptionId
-
description
-
lootTable
-
dimensions
-
requiredFeatures
-
velocityUpdateSupplier
-
trackingRangeSupplier
-
updateIntervalSupplier
-
customClientFactory
-
-
Constructor Details
-
EntityType
public EntityType(EntityType.EntityFactory<T> p_273268_, MobCategory p_272918_, boolean p_273417_, boolean p_273389_, boolean p_273556_, boolean p_272654_, com.google.common.collect.ImmutableSet<Block> p_273631_, EntityDimensions p_272946_, int p_272895_, int p_273451_, FeatureFlagSet p_273518_) -
EntityType
public EntityType(EntityType.EntityFactory<T> p_251402_, MobCategory p_251431_, boolean p_251439_, boolean p_251973_, boolean p_252007_, boolean p_250908_, com.google.common.collect.ImmutableSet<Block> p_250201_, EntityDimensions p_251742_, int p_250479_, int p_249249_, FeatureFlagSet p_250427_, Predicate<EntityType<?>> velocityUpdateSupplier, ToIntFunction<EntityType<?>> trackingRangeSupplier, ToIntFunction<EntityType<?>> updateIntervalSupplier, BiFunction<PlayMessages.SpawnEntity, Level, T> customClientFactory)
-
-
Method Details
-
register
private static <T extends Entity> EntityType<T> register(String p_20635_, EntityType.Builder<T> p_20636_) -
getKey
-
byString
-
spawn
@Nullable public T spawn(ServerLevel p_20593_, @Nullable ItemStack p_20594_, @Nullable Player p_20595_, BlockPos p_20596_, MobSpawnType p_20597_, boolean p_20598_, boolean p_20599_) -
createDefaultStackConfig
public static <T extends Entity> Consumer<T> createDefaultStackConfig(ServerLevel p_263583_, ItemStack p_263568_, @Nullable Player p_263575_) -
appendDefaultStackConfig
-
appendCustomNameConfig
-
appendCustomEntityStackConfig
-
spawn
-
spawn
@Nullable public T spawn(ServerLevel p_262704_, @Nullable CompoundTag p_262603_, @Nullable Consumer<T> p_262621_, BlockPos p_262672_, MobSpawnType p_262644_, boolean p_262690_, boolean p_262590_) -
create
@Nullable public T create(ServerLevel p_262637_, @Nullable CompoundTag p_262687_, @Nullable Consumer<T> p_262629_, BlockPos p_262595_, MobSpawnType p_262666_, boolean p_262685_, boolean p_262588_) -
getYOffset
protected static double getYOffset(LevelReader p_20626_, BlockPos p_20627_, boolean p_20628_, AABB p_20629_) -
updateCustomEntityTag
public static void updateCustomEntityTag(Level p_20621_, @Nullable Player p_20622_, @Nullable Entity p_20623_, @Nullable CompoundTag p_20624_) -
canSerialize
public boolean canSerialize() -
canSummon
public boolean canSummon() -
fireImmune
public boolean fireImmune() -
canSpawnFarFromPlayer
public boolean canSpawnFarFromPlayer() -
getCategory
-
getDescriptionId
-
getDescription
-
toString
-
toShortString
-
getDefaultLootTable
-
getWidth
public float getWidth() -
getHeight
public float getHeight() -
requiredFeatures
- Specified by:
requiredFeatures
in interfaceFeatureElement
-
create
-
create
-
getAABB
-
isBlockDangerous
-
getDimensions
-
by
-
loadEntityRecursive
-
loadEntitiesRecursive
-
loadStaticEntity
-
clientTrackingRange
public int clientTrackingRange() -
defaultTrackingRangeSupplier
private int defaultTrackingRangeSupplier() -
updateInterval
public int updateInterval() -
defaultUpdateIntervalSupplier
private int defaultUpdateIntervalSupplier() -
trackDeltas
public boolean trackDeltas() -
defaultVelocitySupplier
private boolean defaultVelocitySupplier() -
is
-
tryCast
- Specified by:
tryCast
in interfaceEntityTypeTest<Entity,
T extends Entity>
-
getBaseClass
- Specified by:
getBaseClass
in interfaceEntityTypeTest<Entity,
T extends Entity>
-
builtInRegistryHolder
Deprecated. -
customClientSpawn
-
getTags
-