org.bukkit.metadata
Interface Metadatable

All Known Subinterfaces:
Ageable, Ambient, Animals, Arrow, Bat, Blaze, Block, BlockState, Boat, BrewingStand, CaveSpider, Chest, Chicken, CommandBlock, ComplexEntityPart, ComplexLivingEntity, Cow, Creature, CreatureSpawner, Creeper, Damageable, Dispenser, Egg, EnderCrystal, EnderDragon, EnderDragonPart, Enderman, EnderPearl, EnderSignal, Entity, ExperienceOrb, Explosive, ExplosiveMinecart, FallingBlock, FallingSand, Fireball, Firework, Fish, Flying, Furnace, Ghast, Giant, Golem, Hanging, Hopper, HopperMinecart, HumanEntity, IronGolem, Item, ItemFrame, Jukebox, LargeFireball, LightningStrike, LivingEntity, MagmaCube, Minecart, Monster, MushroomCow, NoteBlock, NPC, Ocelot, Painting, Pig, PigZombie, Player, PoweredMinecart, PoweredMinecart, Projectile, RideableMinecart, Sheep, Sign, Silverfish, Skeleton, Skull, Slime, SmallFireball, Snowball, Snowman, SpawnerMinecart, Spider, Squid, StorageMinecart, StorageMinecart, ThrownExpBottle, ThrownPotion, TNTPrimed, Vehicle, Villager, WaterMob, Weather, Witch, Wither, WitherSkull, Wolf, World, Zombie

public interface Metadatable

This interface is implemented by all objects that can provide metadata about themselves.


Method Summary
 List<MetadataValue> 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.
 

Method Detail

setMetadata

void setMetadata(String metadataKey,
                 MetadataValue newMetadataValue)
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

List<MetadataValue> getMetadata(String metadataKey)
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

boolean hasMetadata(String metadataKey)
Tests to see whether the implementing object contains the given metadata value in its metadata store.

Parameters:
metadataKey - the unique metadata key being queried.
Returns:
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.

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


Copyright © 2013. All Rights Reserved.