Interface Metadatable
- All Known Subinterfaces:
AbstractArrow, AbstractCow, AbstractHorse, AbstractNautilus, AbstractSkeleton, AbstractVillager, AbstractWindCharge, AcaciaBoat, AcaciaChestBoat, Ageable, Allay, Ambient, Animals, AreaEffectCloud, Armadillo, ArmorStand, Arrow, Axolotl, BambooChestRaft, BambooRaft, Banner, Barrel, Bat, Beacon, Bed, Bee, Beehive, Bell, BirchBoat, BirchChestBoat, BlastFurnace, Blaze, Block, BlockDisplay, BlockState, Boat, Bogged, Boss, Breedable, Breeze, BreezeWindCharge, BrewingStand, BrushableBlock, Bucketable, CalibratedSculkSensor, Camel, CamelHusk, Campfire, Cat, CaveSpider, CherryBoat, CherryChestBoat, Chest, ChestBoat, ChestedHorse, Chicken, ChiseledBookshelf, Cod, CollarColorable, CommandBlock, CommandMinecart, Comparator, ComplexEntityPart, ComplexLivingEntity, Conduit, Container, CopperGolem, CopperGolemStatue, Cow, Crafter, Creaking, CreakingHeart, Creature, CreatureSpawner, Creeper, Damageable, DarkOakBoat, DarkOakChestBoat, 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, HappyGhast, Hoglin, Hopper, HopperMinecart, Horse, HumanEntity, Husk, Illager, Illusioner, Interaction, IronGolem, Item, ItemDisplay, ItemFrame, Jigsaw, Jukebox, JungleBoat, JungleChestBoat, LargeFireball, Leashable, LeashHitch, Lectern, LightningStrike, LingeringPotion, LivingEntity, Llama, LlamaSpit, LockableTileState, MagmaCube, MangroveBoat, MangroveChestBoat, Mannequin, Marker, Minecart, Mob, Monster, MovingPiston, Mule, MushroomCow, Nautilus, NPC, OakBoat, OakChestBoat, Ocelot, OminousItemSpawner, Painting, PaleOakBoat, PaleOakChestBoat, Panda, Parched, Parrot, Phantom, Pig, Piglin, PiglinAbstract, PiglinBrute, PigZombie, Pillager, Player, PolarBear, PoweredMinecart, Projectile, PufferFish, Rabbit, Raider, RangedEntity, Ravager, RideableMinecart, Salmon, SchoolableFish, SculkCatalyst, SculkSensor, SculkShrieker, Shearable, Sheep, Shelf, Shulker, ShulkerBox, ShulkerBullet, Sign, Silverfish, Sittable, SizedFireball, Skeleton, SkeletonHorse, Skull, Slime, SmallFireball, Smoker, Sniffer, Snowball, Snowman, SpawnerMinecart, SpectralArrow, Spellcaster, Spider, SplashPotion, SpruceBoat, SpruceChestBoat, Squid, Steerable, StorageMinecart, Stray, Strider, Structure, SuspiciousSand, Tadpole, Tameable, TestBlock, TestInstanceBlock, TextDisplay, ThrowableProjectile, ThrownExpBottle, ThrownPotion, TileState, TileStateInventoryHolder, 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, ZombieNautilus, ZombieVillager
Deprecated.
This interface is implemented by all objects that can provide metadata
about themselves.
-
Method Summary
Modifier and TypeMethodDescriptiongetMetadata(@NotNull String metadataKey) Deprecated.Returns a list of previously set metadata values from the implementing object's metadata store.booleanhasMetadata(@NotNull String metadataKey) Deprecated.Tests to see whether the implementing object contains the given metadata value in its metadata store.voidremoveMetadata(@NotNull String metadataKey, @NotNull Plugin owningPlugin) Deprecated.Removes the given metadata value from the implementing object's metadata store.voidsetMetadata(@NotNull String metadataKey, @NotNull MetadataValue newMetadataValue) Deprecated.Sets a metadata value in the implementing object's metadata store.
-
Method Details
-
setMetadata
void setMetadata(@NotNull @NotNull String metadataKey, @NotNull @NotNull MetadataValue newMetadataValue) Deprecated.Sets a metadata value in the implementing object's metadata store.- Parameters:
metadataKey- A unique key to identify this metadata.newMetadataValue- The metadata value to apply.- Throws:
IllegalArgumentException- If value is null, or the owning plugin is null
-
getMetadata
Deprecated.Returns a list of previously set metadata values from the implementing object's metadata store.- Parameters:
metadataKey- the unique metadata key being sought.- Returns:
- A list of values, one for each plugin that has set the requested value.
-
hasMetadata
-
removeMetadata
Deprecated.Removes the given metadata value from the implementing object's metadata store.- Parameters:
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.- Throws:
IllegalArgumentException- If plugin is null
-
PersistentDataContainer.If you want temporary values on an entity, use the entity lifecycle events and a
Mapof your own. (SeeEntityAddToWorldEventandEntityRemoveFromWorldEvent)