接口 Metadatable

所有已知子接口:
AbstractHorse, Ageable, Ambient, Animals, AreaEffectCloud, ArmorStand, Arrow, Banner, Bat, Beacon, Bed, Blaze, Block, BlockState, Boat, BrewingStand, CaveSpider, Chest, ChestedHorse, Chicken, CommandBlock, CommandMinecart, Comparator, ComplexEntityPart, ComplexLivingEntity, Container, Cow, Creature, CreatureSpawner, Creeper, Damageable, DaylightDetector, Dispenser, Donkey, DragonFireball, Dropper, Egg, ElderGuardian, EnchantingTable, EnderChest, EnderCrystal, EnderDragon, EnderDragonPart, Enderman, Endermite, EnderPearl, EnderSignal, EndGateway, Entity, Evoker, EvokerFangs, ExperienceOrb, Explosive, ExplosiveMinecart, FallingBlock, Fireball, Firework, Fish, FishHook, FlowerPot, Flying, Furnace, Ghast, Giant, Golem, Guardian, Hanging, Hopper, HopperMinecart, Horse, HumanEntity, Husk, Illager, Illusioner, IronGolem, Item, ItemFrame, Jukebox, LargeFireball, LeashHitch, LightningStrike, LingeringPotion, LivingEntity, Llama, LlamaSpit, MagmaCube, Minecart, Monster, Mule, MushroomCow, NoteBlock, NPC, Ocelot, Painting, Parrot, Pig, PigZombie, Player, PolarBear, PoweredMinecart, Projectile, Rabbit, RideableMinecart, Sheep, Shulker, ShulkerBox, ShulkerBullet, Sign, Silverfish, Skeleton, SkeletonHorse, Skull, Slime, SmallFireball, Snowball, Snowman, SpawnerMinecart, SpectralArrow, Spellcaster, Spider, SplashPotion, Squid, StorageMinecart, Stray, Structure, Tameable, ThrownExpBottle, ThrownPotion, TippedArrow, TNTPrimed, Vehicle, Vex, Villager, Vindicator, WaterMob, Weather, Witch, Wither, WitherSkeleton, WitherSkull, Wolf, World, Zombie, ZombieHorse, ZombieVillager

public interface Metadatable
This interface is implemented by all objects that can provide metadata about themselves.
  • 方法概要

    修饰符和类型
    方法
    说明
    getMetadata(String metadataKey)
    Returns a list of previously set metadata values from the implementing object's metadata store.
    boolean
    hasMetadata(String metadataKey)
    Tests to see whether the implementing object contains the given metadata value in its metadata store.
    void
    removeMetadata(String metadataKey, Plugin owningPlugin)
    Removes the given metadata value from the implementing object's metadata store.
    void
    setMetadata(String metadataKey, MetadataValue newMetadataValue)
    Sets a metadata value in the implementing object's metadata store.
  • 方法详细资料

    • setMetadata

      void setMetadata(String metadataKey, MetadataValue newMetadataValue)
      Sets a metadata value in the implementing object's metadata store.
      参数:
      metadataKey - A unique key to identify this metadata.
      newMetadataValue - The metadata value to apply.
      抛出:
      IllegalArgumentException - If value is null, or the owning plugin is null
    • getMetadata

      List<MetadataValue> getMetadata(String metadataKey)
      Returns a list of previously set metadata values from the implementing object's metadata store.
      参数:
      metadataKey - the unique metadata key being sought.
      返回:
      A list of values, one for each plugin that has set the requested value.
    • hasMetadata

      boolean hasMetadata(String metadataKey)
      Tests to see whether the implementing object contains the given metadata value in its metadata store.
      参数:
      metadataKey - the unique metadata key being queried.
      返回:
      the existence of the metadataKey within subject.
    • removeMetadata

      void removeMetadata(String metadataKey, Plugin owningPlugin)
      Removes the given metadata value from the implementing object's metadata store.
      参数:
      metadataKey - the unique metadata key identifying the metadata to remove.
      owningPlugin - This plugin's metadata value will be removed. All other values will be left untouched.
      抛出:
      IllegalArgumentException - If plugin is null