Package io.papermc.paper.datacomponent
Interface DataComponentHolder
- All Superinterfaces:
DataComponentView
- All Known Implementing Classes:
ItemStack
This represents an object capable of holding and mutating data components.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Marks this non-valued data component type as present in this itemstack.<T> void
setData
(@NotNull DataComponentType.Valued<T> type, DataComponentBuilder<T> valueBuilder) Sets the value of the data component type for this holder.<T> void
setData
(@NotNull DataComponentType.Valued<T> type, T value) Sets the value of the data component type for this holder.Methods inherited from interface io.papermc.paper.datacomponent.DataComponentView
getData, getDataOrDefault, hasData
-
Method Details
-
setData
@Experimental <T> void setData(@NotNull DataComponentType.Valued<T> type, @NotNull DataComponentBuilder<T> valueBuilder) Sets the value of the data component type for this holder.- Type Parameters:
T
- value type- Parameters:
type
- the data component typevalueBuilder
- value builder
-
setData
Sets the value of the data component type for this holder.- Type Parameters:
T
- value type- Parameters:
type
- the data component typevalue
- value to set
-
setData
Marks this non-valued data component type as present in this itemstack.- Parameters:
type
- the data component type
-