Package net.minestom.server.tag
Interface Taggable
- All Superinterfaces:
TagReadable,TagWritable
- All Known Subinterfaces:
CommandSender
- 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
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> TgetAndSetTag(@NotNull Tag<T> tag, T value) Reads the current value, and then write the new one.default <T> @UnknownNullability TgetAndUpdateTag(@NotNull Tag<T> tag, @NotNull UnaryOperator<@UnknownNullability T> value) default <T> @UnknownNullability TReads the specified tag.default booleanReturns if a tag is present.default voiddefault <T> voidWrites the specified type.@NotNull TagHandlerdefault <T> @UnknownNullability TupdateAndGetTag(@NotNull Tag<T> tag, @NotNull UnaryOperator<@UnknownNullability T> value) default <T> voidupdateTag(@NotNull Tag<T> tag, @NotNull UnaryOperator<@UnknownNullability T> value)
-
Method Details
-
tagHandler
-
getTag
Description copied from interface:TagReadableReads the specified tag.- Specified by:
getTagin interfaceTagReadable- Type Parameters:
T- the tag type- Parameters:
tag- the tag to read- Returns:
- the read tag, null if not present
-
hasTag
Description copied from interface:TagReadableReturns if a tag is present.- Specified by:
hasTagin interfaceTagReadable- Parameters:
tag- the tag to check- Returns:
- true if the tag is present, false otherwise
-
setTag
Description copied from interface:TagWritableWrites the specified type.- Specified by:
setTagin interfaceTagWritable- Type Parameters:
T- the tag type- Parameters:
tag- the tag to writevalue- the tag value, null to remove
-
removeTag
- Specified by:
removeTagin interfaceTagWritable
-
getAndSetTag
Description copied from interface:TagWritableReads the current value, and then write the new one.- Specified by:
getAndSetTagin interfaceTagWritable- 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
default <T> void updateTag(@NotNull @NotNull Tag<T> tag, @NotNull @NotNull UnaryOperator<@UnknownNullability T> value) - Specified by:
updateTagin interfaceTagWritable
-
updateAndGetTag
default <T> @UnknownNullability T updateAndGetTag(@NotNull @NotNull Tag<T> tag, @NotNull @NotNull UnaryOperator<@UnknownNullability T> value) - Specified by:
updateAndGetTagin interfaceTagWritable
-
getAndUpdateTag
default <T> @UnknownNullability T getAndUpdateTag(@NotNull @NotNull Tag<T> tag, @NotNull @NotNull UnaryOperator<@UnknownNullability T> value) - Specified by:
getAndUpdateTagin interfaceTagWritable
-