接口 Mob

所有超级接口:
Attributable, CommandSender, Damageable, Entity, Leashable, LivingEntity, Lootable, Metadatable, Nameable, Permissible, PersistentDataHolder, ProjectileSource, ServerOperator
所有已知子接口:
AbstractCow, AbstractCubeMob, AbstractHorse, AbstractNautilus, AbstractSkeleton, AbstractVillager, Ageable, Allay, Ambient, Animals, Armadillo, Axolotl, Bat, Bee, Blaze, Bogged, Breedable, Breeze, Camel, CamelHusk, Cat, CaveSpider, ChestedHorse, Chicken, Cod, CopperGolem, Cow, Creaking, Creature, Creeper, Dolphin, Donkey, Drowned, ElderGuardian, EnderDragon, Enderman, Endermite, Evoker, Fish, Flying, Fox, Frog, Ghast, Giant, GlowSquid, Goat, Golem, Guardian, HappyGhast, Hoglin, Horse, Husk, Illager, Illusioner, IronGolem, Llama, MagmaCube, Monster, Mule, MushroomCow, Nautilus, NPC, Ocelot, Panda, Parched, Parrot, Phantom, Pig, Piglin, PiglinAbstract, PiglinBrute, PigZombie, Pillager, PolarBear, PufferFish, Rabbit, Raider, Ravager, Salmon, Sheep, Shulker, Silverfish, Skeleton, SkeletonHorse, Slime, Sniffer, Snowman, Spellcaster, Spider, Squid, Steerable, Stray, Strider, SulfurCube, Tadpole, Tameable, TraderLlama, TropicalFish, Turtle, Vex, Villager, Vindicator, WanderingTrader, Warden, WaterMob, Witch, Wither, WitherSkeleton, Wolf, Zoglin, Zombie, ZombieHorse, ZombieNautilus, ZombieVillager

public interface Mob extends LivingEntity, Lootable
代表一个生物。生物是具有简单AI的活体实体。
  • 方法详细资料

    • setTarget

      void setTarget(@Nullable @Nullable LivingEntity target)
      指示此生物将指定的活体实体设为其目标。

      原文:Instructs this Mob to set the specified LivingEntity as its target.

      敌对生物可能会攻击其目标,友好生物可能会跟随其目标。

      参数:
      target - 新的目标活体实体,或 null 以清除目标
    • getTarget

      获取此生物的当前目标。

      原文:Gets the current target of this Mob

      返回:
      此生物的当前目标,如果不存在则为 null
    • setAware

      void setAware(boolean aware)
      设置此生物是否意识到周围环境。

      原文:Sets whether this mob is aware of its surroundings.

      未意识到周围环境的生物在被推、被攻击等情况下仍会移动,但不会自行移动或执行任何操作。 未意识到周围环境的生物可能还会禁用其他未明确指定的行为,例如溺水。

      参数:
      aware - 生物是否意识到周围环境
    • isAware

      boolean isAware()
      获取此生物是否意识到周围环境。

      原文:Gets whether this mob is aware of its surroundings.

      未意识到周围环境的生物在被推、被攻击等情况下仍会移动,但不会自行移动或执行任何操作。 未意识到周围环境的生物可能还会禁用其他未明确指定的行为,例如溺水。

      返回:
      生物是否意识到周围环境
    • getAmbientSound

      @Nullable @Nullable Sound getAmbientSound()
      获取此生物在环境存在时发出的Sound声音。此声音可能因实体当前状态而异,也可能在特定条件下返回null。此声音不是恒定的。

      原文:Get the Sound this mob makes while ambiently existing. This sound may change depending on the current state of the entity, and may also return null under specific conditions. This sound is not constant. For instance, villagers will make different passive noises depending on whether or not they are actively trading with a player, or make no ambient noise while sleeping.

      返回:
      环境声音,如果此实体在环境中静默则为 null