Class CustomData
java.lang.Object
net.minecraft.world.item.component.CustomData
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<CustomData> static final com.mojang.serialization.Codec
<CustomData> static final CustomData
private static final org.slf4j.Logger
static final StreamCodec
<io.netty.buffer.ByteBuf, CustomData> Deprecated.private final CompoundTag
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
copyTag()
boolean
Deprecated.int
hashCode()
boolean
isEmpty()
itemMatcher
(DataComponentType<CustomData> componentType, CompoundTag tag) void
boolean
loadInto
(BlockEntity blockEntity, HolderLookup.Provider levelRegistry) boolean
matchedBy
(CompoundTag tag) static CustomData
of
(CompoundTag tag) <T> com.mojang.serialization.DataResult
<T> <T> com.mojang.serialization.DataResult
<T> read
(com.mojang.serialization.MapDecoder<T> decoder) static void
set
(DataComponentType<CustomData> componentType, ItemStack stack, CompoundTag tag) int
size()
toString()
<T> com.mojang.serialization.DataResult
<CustomData> update
(com.mojang.serialization.DynamicOps<Tag> ops, com.mojang.serialization.MapEncoder<T> encoder, T value) update
(Consumer<CompoundTag> updater) static void
update
(DataComponentType<CustomData> componentType, ItemStack stack, Consumer<CompoundTag> updater)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
EMPTY
-
CODEC
-
CODEC_WITH_ID
-
STREAM_CODEC
Deprecated. -
tag
-
-
Constructor Details
-
CustomData
-
-
Method Details
-
of
-
itemMatcher
public static Predicate<ItemStack> itemMatcher(DataComponentType<CustomData> componentType, CompoundTag tag) -
matchedBy
-
update
public static void update(DataComponentType<CustomData> componentType, ItemStack stack, Consumer<CompoundTag> updater) -
set
public static void set(DataComponentType<CustomData> componentType, ItemStack stack, CompoundTag tag) -
update
-
loadInto
-
loadInto
-
update
public <T> com.mojang.serialization.DataResult<CustomData> update(com.mojang.serialization.DynamicOps<Tag> ops, com.mojang.serialization.MapEncoder<T> encoder, T value) -
read
public <T> com.mojang.serialization.DataResult<T> read(com.mojang.serialization.MapDecoder<T> decoder) -
read
public <T> com.mojang.serialization.DataResult<T> read(com.mojang.serialization.DynamicOps<Tag> ops, com.mojang.serialization.MapDecoder<T> decoder) -
size
public int size() -
isEmpty
public boolean isEmpty() -
copyTag
-
contains
-
equals
-
hashCode
public int hashCode() -
toString
-
getUnsafe
Deprecated.
-