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 Summary

    Modifier and Type
    Method
    Description
    <T> T
    getAndSetTag(@NotNull Tag<T> tag, T value)
    Reads the current value, and then write the new one.
    <T> @UnknownNullability T
    getAndUpdateTag(@NotNull Tag<T> tag, @NotNull UnaryOperator<@UnknownNullability T> value)
     
    default void
    removeTag(@NotNull Tag<?> tag)
     
    <T> void
    setTag(@NotNull Tag<T> tag, T value)
    Writes the specified type.
    <T> @UnknownNullability T
    updateAndGetTag(@NotNull Tag<T> tag, @NotNull UnaryOperator<@UnknownNullability T> value)
     
    <T> void
    updateTag(@NotNull Tag<T> tag, @NotNull UnaryOperator<@UnknownNullability T> value)
     

    Methods inherited from interface net.minestom.server.tag.TagReadable

    getTag, hasTag
  • Method Details

    • setTag

      <T> void setTag(@NotNull @NotNull 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(@NotNull @NotNull Tag<?> tag)
    • getAndSetTag

      @Nullable <T> T getAndSetTag(@NotNull @NotNull 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(@NotNull @NotNull Tag<T> tag, @NotNull @NotNull UnaryOperator<@UnknownNullability T> value)
    • updateAndGetTag

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

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