Interface MetadataValue

All Known Implementing Classes:
FixedMetadataValue, LazyMetadataValue, MetadataValueAdapter

@Deprecated public interface MetadataValue
Deprecated.
This system is extremely misleading and does not cleanup values for metadatable entities that have been removed. It is recommended that when wanting persistent metadata, you use PersistentDataContainer. If you want temporary values on an entity, just use the entity lifecycle events. (See EntityAddToWorldEvent0
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Deprecated.
    Attempts to convert the value of this metadata item into a boolean.
    byte
    Deprecated.
    Attempts to convert the value of this metadata item into a byte.
    double
    Deprecated.
    Attempts to convert the value of this metadata item into a double.
    float
    Deprecated.
    Attempts to convert the value of this metadata item into a float.
    int
    Deprecated.
    Attempts to convert the value of this metadata item into an int.
    long
    Deprecated.
    Attempts to convert the value of this metadata item into a long.
    short
    Deprecated.
    Attempts to convert the value of this metadata item into a short.
    Deprecated.
    Attempts to convert the value of this metadata item into a string.
    Deprecated.
    Returns the Plugin that created this metadata item.
    void
    Deprecated.
    Invalidates this metadata item, forcing it to recompute when next accessed.
    Deprecated.
    Fetches the value of this metadata item.
  • Method Details

    • value

      Deprecated.
      Fetches the value of this metadata item.
      Returns:
      the metadata value.
    • asInt

      int asInt()
      Deprecated.
      Attempts to convert the value of this metadata item into an int.
      Returns:
      the value as an int.
    • asFloat

      float asFloat()
      Deprecated.
      Attempts to convert the value of this metadata item into a float.
      Returns:
      the value as a float.
    • asDouble

      double asDouble()
      Deprecated.
      Attempts to convert the value of this metadata item into a double.
      Returns:
      the value as a double.
    • asLong

      long asLong()
      Deprecated.
      Attempts to convert the value of this metadata item into a long.
      Returns:
      the value as a long.
    • asShort

      short asShort()
      Deprecated.
      Attempts to convert the value of this metadata item into a short.
      Returns:
      the value as a short.
    • asByte

      byte asByte()
      Deprecated.
      Attempts to convert the value of this metadata item into a byte.
      Returns:
      the value as a byte.
    • asBoolean

      boolean asBoolean()
      Deprecated.
      Attempts to convert the value of this metadata item into a boolean.
      Returns:
      the value as a boolean.
    • asString

      Deprecated.
      Attempts to convert the value of this metadata item into a string.
      Returns:
      the value as a string.
    • getOwningPlugin

      @Nullable @Nullable Plugin getOwningPlugin()
      Deprecated.
      Returns the Plugin that created this metadata item.
      Returns:
      the plugin that owns this metadata value. Could be null if the plugin was already unloaded.
    • invalidate

      void invalidate()
      Deprecated.
      Invalidates this metadata item, forcing it to recompute when next accessed.