接口 Metadatable

所有已知子接口:
AbstractArrow, AbstractHorse, AbstractSkeleton, AbstractVillager, AbstractWindCharge, Ageable, Allay, Ambient, Animals, AreaEffectCloud, Armadillo, ArmorStand, Arrow, Axolotl, Banner, Barrel, Bat, Beacon, Bed, Bee, Beehive, Bell, BlastFurnace, Blaze, Block, BlockDisplay, BlockState, Boat, Bogged, Boss, Breedable, Breeze, BreezeWindCharge, BrewingStand, BrushableBlock, CalibratedSculkSensor, Camel, Campfire, Cat, CaveSpider, Chest, ChestBoat, ChestedHorse, Chicken, ChiseledBookshelf, Cod, CommandBlock, CommandMinecart, Comparator, ComplexEntityPart, ComplexLivingEntity, Conduit, Container, Cow, Crafter, Creature, CreatureSpawner, Creeper, Damageable, DaylightDetector, DecoratedPot, Dispenser, Display, Dolphin, Donkey, DragonFireball, Dropper, Drowned, Egg, ElderGuardian, EnchantingTable, EnderChest, EnderCrystal, EnderDragon, EnderDragonPart, Enderman, Endermite, EnderPearl, EnderSignal, EndGateway, Enemy, Entity, EntityBlockStorage<T>, Evoker, EvokerFangs, ExperienceOrb, Explosive, ExplosiveMinecart, FallingBlock, Fireball, Firework, Fish, FishHook, Flying, Fox, Frog, Furnace, Ghast, Giant, GlowItemFrame, GlowSquid, Goat, Golem, Guardian, Hanging, HangingSign, Hoglin, Hopper, HopperMinecart, Horse, HumanEntity, Husk, Illager, Illusioner, Interaction, IronGolem, Item, ItemDisplay, ItemFrame, Jigsaw, Jukebox, LargeFireball, LeashHitch, Lectern, LightningStrike, LingeringPotion, LivingEntity, Llama, LlamaSpit, MagmaCube, Marker, Minecart, Mob, Monster, Mule, MushroomCow, NPC, Ocelot, OminousItemSpawner, Painting, Panda, Parrot, Phantom, Pig, Piglin, PiglinAbstract, PiglinBrute, PigZombie, Pillager, Player, PolarBear, PoweredMinecart, Projectile, PufferFish, Rabbit, Raider, Ravager, RideableMinecart, Salmon, SculkCatalyst, SculkSensor, SculkShrieker, Sheep, Shulker, ShulkerBox, ShulkerBullet, Sign, Silverfish, SizedFireball, Skeleton, SkeletonHorse, Skull, Slime, SmallFireball, Smoker, Sniffer, Snowball, Snowman, SpawnerMinecart, SpectralArrow, Spellcaster, Spider, SplashPotion, Squid, Steerable, StorageMinecart, Stray, Strider, Structure, SuspiciousSand, Tadpole, Tameable, TextDisplay, ThrowableProjectile, ThrownExpBottle, ThrownPotion, TileState, TippedArrow, TNTPrimed, TraderLlama, TrialSpawner, Trident, TropicalFish, Turtle, Vault, Vehicle, Vex, Villager, Vindicator, WanderingTrader, Warden, WaterMob, WindCharge, Witch, Wither, WitherSkeleton, WitherSkull, Wolf, World, Zoglin, Zombie, ZombieHorse, ZombieVillager

public interface Metadatable
This interface is implemented by all objects that can provide metadata about themselves.
  • 方法详细资料

    • setMetadata

      void setMetadata(@NotNull @NotNull String metadataKey, @NotNull @NotNull 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

      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(@NotNull @NotNull 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(@NotNull @NotNull String metadataKey, @NotNull @NotNull 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