Modifier and Type | Class and Description |
---|---|
static class |
EntityType.Builder<T extends Entity> |
static interface |
EntityType.EntityFactory<T extends Entity> |
Constructor and 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) |
Modifier and Type | Method and Description |
---|---|
boolean |
alwaysUpdateVelocity() |
T |
create(ServerWorld serverWorld,
CompoundTag itemTag,
Text name,
PlayerEntity player,
BlockPos pos,
SpawnReason spawnReason,
boolean alignPosition,
boolean invertY) |
T |
create(World world) |
static Entity |
createInstanceFromId(int type,
World world) |
Box |
createSimpleBoundingBox(double feetX,
double feetY,
double feetZ) |
static Optional<EntityType<?>> |
fromTag(CompoundTag compoundTag) |
static Optional<EntityType<?>> |
get(String id) |
EntityDimensions |
getDimensions() |
static Optional<Entity> |
getEntityFromTag(CompoundTag tag,
World world) |
float |
getHeight() |
static Identifier |
getId(EntityType<?> type) |
Identifier |
getLootTableId() |
int |
getMaxTrackDistance()
Returns the tracking distance, in chunks, of this type of entity
for clients.
|
Text |
getName() |
protected static double |
getOriginY(WorldView world,
BlockPos pos,
boolean invertY,
Box boundingBox) |
SpawnGroup |
getSpawnGroup() |
int |
getTrackTickInterval() |
String |
getTranslationKey() |
float |
getWidth() |
boolean |
isFireImmune() |
boolean |
isIn(Tag<EntityType<?>> tag) |
boolean |
isInvalidSpawn(BlockState blockState)
Returns whether the EntityType can spawn inside the given block.
|
boolean |
isSaveable() |
boolean |
isSpawnableFarFromPlayer() |
boolean |
isSummonable() |
private static Optional<Entity> |
loadEntityFromTag(CompoundTag compoundTag,
World world) |
static Entity |
loadEntityWithPassengers(CompoundTag compoundTag,
World world,
Function<Entity,Entity> entityProcessor) |
static void |
loadFromEntityTag(World world,
PlayerEntity player,
Entity entity,
CompoundTag itemTag) |
private static Entity |
newInstance(World world,
EntityType<?> type) |
private static <T extends Entity> |
register(String id,
EntityType.Builder<T> type) |
T |
spawn(ServerWorld serverWorld,
CompoundTag itemTag,
Text name,
PlayerEntity player,
BlockPos pos,
SpawnReason spawnReason,
boolean alignPosition,
boolean invertY) |
Entity |
spawnFromItemStack(ServerWorld serverWorld,
ItemStack stack,
PlayerEntity player,
BlockPos pos,
SpawnReason spawnReason,
boolean alignPosition,
boolean invertY) |
String |
toString() |
private static final Logger LOGGER
public static final EntityType<AreaEffectCloudEntity> AREA_EFFECT_CLOUD
public static final EntityType<ArmorStandEntity> ARMOR_STAND
public static final EntityType<ArrowEntity> ARROW
public static final EntityType<BatEntity> BAT
public static final EntityType<BeeEntity> BEE
public static final EntityType<BlazeEntity> BLAZE
public static final EntityType<BoatEntity> BOAT
public static final EntityType<CatEntity> CAT
public static final EntityType<CaveSpiderEntity> CAVE_SPIDER
public static final EntityType<ChickenEntity> CHICKEN
public static final EntityType<CodEntity> COD
public static final EntityType<CowEntity> COW
public static final EntityType<CreeperEntity> CREEPER
public static final EntityType<DolphinEntity> DOLPHIN
public static final EntityType<DonkeyEntity> DONKEY
public static final EntityType<DragonFireballEntity> DRAGON_FIREBALL
public static final EntityType<DrownedEntity> DROWNED
public static final EntityType<ElderGuardianEntity> ELDER_GUARDIAN
public static final EntityType<EndCrystalEntity> END_CRYSTAL
public static final EntityType<EnderDragonEntity> ENDER_DRAGON
public static final EntityType<EndermanEntity> ENDERMAN
public static final EntityType<EndermiteEntity> ENDERMITE
public static final EntityType<EvokerEntity> EVOKER
public static final EntityType<EvokerFangsEntity> EVOKER_FANGS
public static final EntityType<ExperienceOrbEntity> EXPERIENCE_ORB
public static final EntityType<EyeOfEnderEntity> EYE_OF_ENDER
public static final EntityType<FallingBlockEntity> FALLING_BLOCK
public static final EntityType<FireworkRocketEntity> FIREWORK_ROCKET
public static final EntityType<FoxEntity> FOX
public static final EntityType<GhastEntity> GHAST
public static final EntityType<GiantEntity> GIANT
public static final EntityType<GuardianEntity> GUARDIAN
public static final EntityType<HoglinEntity> HOGLIN
public static final EntityType<HorseEntity> HORSE
public static final EntityType<HuskEntity> HUSK
public static final EntityType<IllusionerEntity> ILLUSIONER
public static final EntityType<IronGolemEntity> IRON_GOLEM
public static final EntityType<ItemEntity> ITEM
public static final EntityType<ItemFrameEntity> ITEM_FRAME
public static final EntityType<FireballEntity> FIREBALL
public static final EntityType<LeashKnotEntity> LEASH_KNOT
public static final EntityType<LightningEntity> LIGHTNING_BOLT
public static final EntityType<LlamaEntity> LLAMA
public static final EntityType<LlamaSpitEntity> LLAMA_SPIT
public static final EntityType<MagmaCubeEntity> MAGMA_CUBE
public static final EntityType<MinecartEntity> MINECART
public static final EntityType<ChestMinecartEntity> CHEST_MINECART
public static final EntityType<CommandBlockMinecartEntity> COMMAND_BLOCK_MINECART
public static final EntityType<FurnaceMinecartEntity> FURNACE_MINECART
public static final EntityType<HopperMinecartEntity> HOPPER_MINECART
public static final EntityType<SpawnerMinecartEntity> SPAWNER_MINECART
public static final EntityType<TntMinecartEntity> TNT_MINECART
public static final EntityType<MuleEntity> MULE
public static final EntityType<MooshroomEntity> MOOSHROOM
public static final EntityType<OcelotEntity> OCELOT
public static final EntityType<PaintingEntity> PAINTING
public static final EntityType<PandaEntity> PANDA
public static final EntityType<ParrotEntity> PARROT
public static final EntityType<PhantomEntity> PHANTOM
public static final EntityType<PigEntity> PIG
public static final EntityType<PiglinEntity> PIGLIN
public static final EntityType<PiglinBruteEntity> PIGLIN_BRUTE
public static final EntityType<PillagerEntity> PILLAGER
public static final EntityType<PolarBearEntity> POLAR_BEAR
public static final EntityType<TntEntity> TNT
public static final EntityType<PufferfishEntity> PUFFERFISH
public static final EntityType<RabbitEntity> RABBIT
public static final EntityType<RavagerEntity> RAVAGER
public static final EntityType<SalmonEntity> SALMON
public static final EntityType<SheepEntity> SHEEP
public static final EntityType<ShulkerEntity> SHULKER
public static final EntityType<ShulkerBulletEntity> SHULKER_BULLET
public static final EntityType<SilverfishEntity> SILVERFISH
public static final EntityType<SkeletonEntity> SKELETON
public static final EntityType<SkeletonHorseEntity> SKELETON_HORSE
public static final EntityType<SlimeEntity> SLIME
public static final EntityType<SmallFireballEntity> SMALL_FIREBALL
public static final EntityType<SnowGolemEntity> SNOW_GOLEM
public static final EntityType<SnowballEntity> SNOWBALL
public static final EntityType<SpectralArrowEntity> SPECTRAL_ARROW
public static final EntityType<SpiderEntity> SPIDER
public static final EntityType<SquidEntity> SQUID
public static final EntityType<StrayEntity> STRAY
public static final EntityType<StriderEntity> STRIDER
public static final EntityType<EggEntity> EGG
public static final EntityType<EnderPearlEntity> ENDER_PEARL
public static final EntityType<ExperienceBottleEntity> EXPERIENCE_BOTTLE
public static final EntityType<PotionEntity> POTION
public static final EntityType<TridentEntity> TRIDENT
public static final EntityType<TraderLlamaEntity> TRADER_LLAMA
public static final EntityType<TropicalFishEntity> TROPICAL_FISH
public static final EntityType<TurtleEntity> TURTLE
public static final EntityType<VexEntity> VEX
public static final EntityType<VillagerEntity> VILLAGER
public static final EntityType<VindicatorEntity> VINDICATOR
public static final EntityType<WanderingTraderEntity> WANDERING_TRADER
public static final EntityType<WitchEntity> WITCH
public static final EntityType<WitherEntity> WITHER
public static final EntityType<WitherSkeletonEntity> WITHER_SKELETON
public static final EntityType<WitherSkullEntity> WITHER_SKULL
public static final EntityType<WolfEntity> WOLF
public static final EntityType<ZoglinEntity> ZOGLIN
public static final EntityType<ZombieEntity> ZOMBIE
public static final EntityType<ZombieHorseEntity> ZOMBIE_HORSE
public static final EntityType<ZombieVillagerEntity> ZOMBIE_VILLAGER
public static final EntityType<ZombifiedPiglinEntity> ZOMBIFIED_PIGLIN
public static final EntityType<PlayerEntity> PLAYER
public static final EntityType<FishingBobberEntity> FISHING_BOBBER
private final EntityType.EntityFactory<T extends Entity> factory
private final SpawnGroup spawnGroup
private final ImmutableSet<Block> canSpawnInside
private final boolean saveable
private final boolean summonable
private final boolean fireImmune
private final boolean spawnableFarFromPlayer
private final int maxTrackDistance
private final int trackTickInterval
@Nullable private Identifier lootTableId
private final EntityDimensions dimensions
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)
private static <T extends Entity> EntityType<T> register(String id, EntityType.Builder<T> type)
public static Identifier getId(EntityType<?> type)
public static Optional<EntityType<?>> get(String id)
@Nullable public Entity spawnFromItemStack(ServerWorld serverWorld, @Nullable ItemStack stack, @Nullable PlayerEntity player, BlockPos pos, SpawnReason spawnReason, boolean alignPosition, boolean invertY)
@Nullable public T spawn(ServerWorld serverWorld, @Nullable CompoundTag itemTag, @Nullable Text name, @Nullable PlayerEntity player, BlockPos pos, SpawnReason spawnReason, boolean alignPosition, boolean invertY)
@Nullable public T create(ServerWorld serverWorld, @Nullable CompoundTag itemTag, @Nullable Text name, @Nullable PlayerEntity player, BlockPos pos, SpawnReason spawnReason, boolean alignPosition, boolean invertY)
protected static double getOriginY(WorldView world, BlockPos pos, boolean invertY, Box boundingBox)
public static void loadFromEntityTag(World world, @Nullable PlayerEntity player, @Nullable Entity entity, @Nullable CompoundTag itemTag)
public boolean isSaveable()
public boolean isSummonable()
public boolean isFireImmune()
public boolean isSpawnableFarFromPlayer()
public SpawnGroup getSpawnGroup()
public String getTranslationKey()
public Text getName()
public Identifier getLootTableId()
public float getWidth()
public float getHeight()
@Environment(value=CLIENT) @Nullable public static Entity createInstanceFromId(int type, World world)
public static Optional<Entity> getEntityFromTag(CompoundTag tag, World world)
@Environment(value=CLIENT) @Nullable private static Entity newInstance(World world, @Nullable EntityType<?> type)
public Box createSimpleBoundingBox(double feetX, double feetY, double feetZ)
public boolean isInvalidSpawn(BlockState blockState)
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[])
public EntityDimensions getDimensions()
public static Optional<EntityType<?>> fromTag(CompoundTag compoundTag)
@Nullable public static Entity loadEntityWithPassengers(CompoundTag compoundTag, World world, Function<Entity,Entity> entityProcessor)
private static Optional<Entity> loadEntityFromTag(CompoundTag compoundTag, World world)
public int getMaxTrackDistance()
public int getTrackTickInterval()
public boolean alwaysUpdateVelocity()
public boolean isIn(Tag<EntityType<?>> tag)