Package net.minestom.server.tag
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,PlayerProjectile,PositionalDamage,ServerSender,SharedInstance,VillagerInventory
Represents an element which can write
tags.-
Method Summary
Modifier and TypeMethodDescription<T> TgetAndSetTag(@NotNull Tag<T> tag, T value) Reads the current value, and then write the new one.<T> @UnknownNullability TgetAndUpdateTag(@NotNull Tag<T> tag, @NotNull UnaryOperator<@UnknownNullability T> value) default void<T> voidWrites the specified type.<T> @UnknownNullability TupdateAndGetTag(@NotNull Tag<T> tag, @NotNull UnaryOperator<@UnknownNullability T> value) <T> voidupdateTag(@NotNull Tag<T> tag, @NotNull UnaryOperator<@UnknownNullability T> value) Methods inherited from interface net.minestom.server.tag.TagReadable
getTag, hasTag
-
Method Details
-
setTag
Writes the specified type.- Type Parameters:
T- the tag type- Parameters:
tag- the tag to writevalue- the tag value, null to remove
-
removeTag
-
getAndSetTag
Reads the current value, and then write the new one.- Type Parameters:
T- the tag type- Parameters:
tag- the tag to writevalue- 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)
-