Interface Taggable

All Superinterfaces:
TagReadable, TagWritable
All Known Subinterfaces:
CommandSender, ItemMeta.Builder, ItemMetaView.Builder
All Known Implementing Classes:
AbstractInventory, AnvilInventory, BeaconInventory, BrewingStandInventory, BundleMeta.Builder, Chunk, CompassMeta.Builder, ConsoleSender, CrossbowMeta.Builder, Damage, DynamicChunk, EnchantedBookMeta.Builder, EnchantmentTableInventory, Entity, EntityCreature, EntityDamage, EntityProjectile, EntityProjectileDamage, ExperienceOrb, FireworkEffectMeta.Builder, FireworkMeta.Builder, FurnaceInventory, Instance, InstanceContainer, Inventory, ItemEntity, LeatherArmorMeta.Builder, LightingChunk, LivingEntity, MapMeta.Builder, Player, PlayerHeadMeta.Builder, PlayerInventory, PlayerProjectile, PositionalDamage, PotionMeta.Builder, ServerSender, SharedInstance, VillagerInventory, WritableBookMeta.Builder, WrittenBookMeta.Builder

public interface Taggable extends TagReadable, TagWritable
  • Method Summary

    Modifier and Type
    Method
    Description
    default <T> @UnknownNullability T
    getTag(@NotNull Tag<T> tag)
    Reads the specified tag.
    default boolean
    hasTag(@NotNull Tag<?> tag)
    Returns if a tag is present.
    default void
    removeTag(@NotNull Tag<?> tag)
     
    default <T> void
    setTag(@NotNull Tag<T> tag, T value)
    Writes the specified type.
    @NotNull TagHandler
     
  • Method Details

    • tagHandler

      @NotNull @NotNull TagHandler tagHandler()
    • getTag

      default <T> @UnknownNullability T getTag(@NotNull @NotNull Tag<T> tag)
      Description copied from interface: TagReadable
      Reads the specified tag.
      Specified by:
      getTag in interface TagReadable
      Type Parameters:
      T - the tag type
      Parameters:
      tag - the tag to read
      Returns:
      the read tag, null if not present
    • hasTag

      default boolean hasTag(@NotNull @NotNull Tag<?> tag)
      Description copied from interface: TagReadable
      Returns if a tag is present.
      Specified by:
      hasTag in interface TagReadable
      Parameters:
      tag - the tag to check
      Returns:
      true if the tag is present, false otherwise
    • setTag

      default <T> void setTag(@NotNull @NotNull Tag<T> tag, @Nullable T value)
      Description copied from interface: TagWritable
      Writes the specified type.
      Specified by:
      setTag in interface TagWritable
      Type Parameters:
      T - the tag type
      Parameters:
      tag - the tag to write
      value - the tag value, null to remove
    • removeTag

      default void removeTag(@NotNull @NotNull Tag<?> tag)
      Specified by:
      removeTag in interface TagWritable