接口 Mob

所有超级接口:
Attributable, CommandSender, Damageable, Entity, LivingEntity, Lootable, Metadatable, Nameable, Permissible, PersistentDataHolder, ProjectileSource, ServerOperator
所有已知子接口:
AbstractHorse, AbstractSkeleton, AbstractVillager, Ageable, Allay, Ambient, Animals, Armadillo, Axolotl, Bat, Bee, Blaze, Bogged, Breedable, Breeze, Camel, Cat, CaveSpider, ChestedHorse, Chicken, Cod, Cow, Creature, Creeper, Dolphin, Donkey, Drowned, ElderGuardian, EnderDragon, Enderman, Endermite, Evoker, Fish, Flying, Fox, Frog, Ghast, Giant, GlowSquid, Goat, Golem, Guardian, Hoglin, Horse, Husk, Illager, Illusioner, IronGolem, Llama, MagmaCube, Monster, Mule, MushroomCow, NPC, Ocelot, Panda, 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, Tadpole, Tameable, TraderLlama, TropicalFish, Turtle, Vex, Villager, Vindicator, WanderingTrader, Warden, WaterMob, Witch, Wither, WitherSkeleton, Wolf, Zoglin, Zombie, ZombieHorse, ZombieVillager

public interface Mob extends LivingEntity, Lootable
Represents a Mob. Mobs are living entities with simple AI.
  • 方法详细资料

    • setTarget

      void setTarget(@Nullable @Nullable LivingEntity target)
      Instructs this Mob to set the specified LivingEntity as its target.

      Hostile creatures may attack their target, and friendly creatures may follow their target.

      参数:
      target - New LivingEntity to target, or null to clear the target
    • getTarget

      Gets the current target of this Mob
      返回:
      Current target of this creature, or null if none exists
    • setAware

      void setAware(boolean aware)
      Sets whether this mob is aware of its surroundings. Unaware mobs will still move if pushed, attacked, etc. but will not move or perform any actions on their own. Unaware mobs may also have other unspecified behaviours disabled, such as drowning.
      参数:
      aware - whether the mob is aware
    • isAware

      boolean isAware()
      Gets whether this mob is aware of its surroundings. Unaware mobs will still move if pushed, attacked, etc. but will not move or perform any actions on their own. Unaware mobs may also have other unspecified behaviours disabled, such as drowning.
      返回:
      whether the mob is aware
    • getAmbientSound

      @Nullable @Nullable Sound getAmbientSound()
      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.
      返回:
      the ambient sound, or null if this entity is ambiently quiet