Interface TagReadable

All Known Subinterfaces:
Block, ChunkSnapshot, CommandSender, EntitySnapshot, InstanceSnapshot, ItemMeta, ItemMeta.Builder, ItemMetaView<T>, ItemMetaView.Builder, ItemStack, PlayerSnapshot, Taggable, TagHandler
All Known Implementing Classes:
AbstractInventory, AnvilInventory, BannerMeta, BannerMeta.Builder, BeaconInventory, BrewingStandInventory, BundleMeta, BundleMeta.Builder, Chunk, CompassMeta, CompassMeta.Builder, ConsoleSender, CrossbowMeta, CrossbowMeta.Builder, Damage, DynamicChunk, EnchantedBookMeta, EnchantedBookMeta.Builder, EnchantmentTableInventory, Entity, EntityCreature, EntityDamage, EntityProjectile, EntityProjectileDamage, ExperienceOrb, FireworkEffectMeta, FireworkEffectMeta.Builder, FireworkMeta, FireworkMeta.Builder, FurnaceInventory, Instance, InstanceContainer, Inventory, ItemEntity, LeatherArmorMeta, LeatherArmorMeta.Builder, LightingChunk, LivingEntity, MapMeta, MapMeta.Builder, Player, PlayerHeadMeta, PlayerHeadMeta.Builder, PlayerInventory, PlayerProjectile, PositionalDamage, PotionMeta, PotionMeta.Builder, ServerSender, SharedInstance, ShieldMeta, ShieldMeta.Builder, SnapshotImpl.Chunk, SnapshotImpl.Entity, SnapshotImpl.Instance, SnapshotImpl.Player, VillagerInventory, WritableBookMeta, WritableBookMeta.Builder, WrittenBookMeta, WrittenBookMeta.Builder

public interface TagReadable
Represents an element which can read tags.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> @UnknownNullability T
    getTag(@NotNull Tag<T> tag)
    Reads the specified tag.
    default boolean
    hasTag(@NotNull Tag<?> tag)
    Returns if a tag is present.
  • Method Details

    • getTag

      <T> @UnknownNullability T getTag(@NotNull @NotNull Tag<T> tag)
      Reads the specified tag.
      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)
      Returns if a tag is present.
      Parameters:
      tag - the tag to check
      Returns:
      true if the tag is present, false otherwise