Interface DataComponent.Holder

All Known Subinterfaces:
DataComponentMap, DataComponentMap.Builder, DataComponentMap.PatchBuilder, ItemStack
Enclosing interface:
DataComponent<T>

public static interface DataComponent.Holder
Represents any type which can hold data components. Represents a finalized view of a component, that is to say an implementation may represent a patch on top of another Holder, however the return values of this type will always represent the merged view.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    get(@NotNull DataComponent<T> component)
     
    default <T> T
    get(@NotNull DataComponent<T> component, T defaultValue)
     
    boolean
    has(@NotNull DataComponent<?> component)
     
  • Method Details

    • has

      boolean has(@NotNull @NotNull DataComponent<?> component)
    • get

      @Nullable <T> T get(@NotNull @NotNull DataComponent<T> component)
    • get

      @NotNull default <T> T get(@NotNull @NotNull DataComponent<T> component, @NotNull T defaultValue)