接口 Attributable

所有已知子接口:
AbstractHorse, Ageable, Ambient, Animals, ArmorStand, Bat, Blaze, CaveSpider, ChestedHorse, Chicken, ComplexLivingEntity, Cow, Creature, Creeper, Donkey, ElderGuardian, EnderDragon, Enderman, Endermite, Evoker, Flying, Ghast, Giant, Golem, Guardian, Horse, HumanEntity, Husk, Illager, Illusioner, IronGolem, LivingEntity, Llama, MagmaCube, Monster, Mule, MushroomCow, NPC, Ocelot, Parrot, Pig, PigZombie, Player, PolarBear, Rabbit, Sheep, Shulker, Silverfish, Skeleton, SkeletonHorse, Slime, Snowman, Spellcaster, Spider, Squid, Stray, Vex, Villager, Vindicator, WaterMob, Witch, Wither, WitherSkeleton, Wolf, Zombie, ZombieHorse, ZombieVillager

public interface Attributable
用于表示一个可以包含属性的对象
  • 方法详细资料

    • getAttribute

      AttributeInstance getAttribute(Attribute attribute)
      从指定的一个对象内获取对应的属性. 这个方法将直接返回包含属性的对象,任何对此对象的变动将立即可见(生效).

      原文:Gets the specified attribute instance from the object. This instance will be backed directly to the object and any changes will be visible at once.

      参数:
      attribute - Attribute实例
      返回:
      这个方法会返回一个AttributeInstance,如果不适用于此对象,将返回null