Interface DataComponentHolder

All Superinterfaces:
DataComponentView
All Known Implementing Classes:
ItemStack

@NullMarked @NonExtendable public interface DataComponentHolder extends DataComponentView
This represents an object capable of holding and mutating data components.
See Also:
  • Method Details

    • setData

      @Experimental <T> void setData(DataComponentType.Valued<T> type, DataComponentBuilder<T> valueBuilder)
      Sets the value of the data component type for this holder.
      Type Parameters:
      T - value type
      Parameters:
      type - the data component type
      valueBuilder - value builder
    • setData

      @Experimental <T> void setData(DataComponentType.Valued<T> type, T value)
      Sets the value of the data component type for this holder.
      Type Parameters:
      T - value type
      Parameters:
      type - the data component type
      value - value to set
    • setData

      Marks this non-valued data component type as present in this itemstack.
      Parameters:
      type - the data component type