Interface TagWritable

All Superinterfaces:
TagReadable
All Known Subinterfaces:
CommandSender, Taggable, TagHandler
All Known Implementing Classes:
AbstractInventory, AnvilInventory, BeaconInventory, BrewingStandInventory, Chunk, ConsoleSender, Damage, DynamicChunk, EnchantmentTableInventory, Entity, EntityCreature, EntityDamage, EntityProjectile, EntityProjectileDamage, ExperienceOrb, FurnaceInventory, Instance, InstanceContainer, Inventory, ItemEntity, LightingChunk, LivingEntity, Player, PlayerInventory, PositionalDamage, ServerSender, SharedInstance, VillagerInventory

public interface TagWritable extends TagReadable
Represents an element which can write tags.
  • Method Details

    • setTag

      <T> void setTag(Tag<T> tag, @Nullable T value)
      Writes the specified type.
      Type Parameters:
      T - the tag type
      Parameters:
      tag - the tag to write
      value - the tag value, null to remove
    • removeTag

      default void removeTag(Tag<?> tag)
    • getAndSetTag

      @Nullable <T> T getAndSetTag(Tag<T> tag, @Nullable T value)
      Reads the current value, and then write the new one.
      Type Parameters:
      T - the tag type
      Parameters:
      tag - the tag to write
      value - the tag value, null to remove
      Returns:
      the previous tag value, null if not present
    • updateTag

      <T> void updateTag(Tag<T> tag, UnaryOperator<@UnknownNullability T> value)
    • updateAndGetTag

      <T> @UnknownNullability T updateAndGetTag(Tag<T> tag, UnaryOperator<@UnknownNullability T> value)
    • getAndUpdateTag

      <T> @UnknownNullability T getAndUpdateTag(Tag<T> tag, UnaryOperator<@UnknownNullability T> value)