java.lang.Object
org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents

public class DataComponents extends Object
Wrapper around a map of data components and their respective values.

This map can either be a complete data component map, or a data component patch to another map. The meaning of null values in the map depends on if the map is a patch or full map. If the map:

  • Is a full map, null means an absence of the component in the map. put(DataComponentType, Object) should not be used with null values, rather remove(DataComponentType) should be used.
  • Is a patch, null can mean an absence of the component in the patch, or that the component should be removed from a map the patch is applied to. Use contains(DataComponentType), which returns true for the latter, to check which is the case.

Make sure to initialise this class with a map that accepts null values if representing a patch.