Package dev.potota.itemstats.api
Class ItemStat<T extends StatValue>
java.lang.Object
dev.potota.itemstats.api.ItemStat<T>
- Direct Known Subclasses:
ItemStat.Float,ItemStat.Integer,ItemStat.RegistryMapped
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classItemStat.RegistryMapped<V extends Comparable<V>,SV extends StatValue.RegistryMapped<V>> static classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ItemStat<?>> protected net.minecraft.resources.ResourceLocation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanappliesTo(net.minecraft.world.item.Item item) booleanappliesTo(net.minecraft.world.item.ItemStack stack) protected Tabstract Tnet.minecraft.network.chat.MutableComponentgetValue(net.minecraft.world.item.ItemStack stack) net.minecraft.resources.ResourceLocationid()protected voidmodifyStat(net.minecraft.world.item.ItemStack stack, UnaryOperator<T> modifier) net.minecraft.network.chat.Componentname()
-
Field Details
-
AS_ID_CODEC
-
valueClass
-
id
protected net.minecraft.resources.ResourceLocation id
-
-
Constructor Details
-
ItemStat
-
-
Method Details
-
appliesTo
- Throws:
IllegalStateException- if called before item tags are loaded (i.e. when not in a world)
-
appliesTo
- Throws:
IllegalStateException- if called before item tags are loaded (i.e. when not in a world)
-
id
public net.minecraft.resources.ResourceLocation id() -
defaultValue
-
format
-
name
public net.minecraft.network.chat.Component name() -
castValue
-
getValue
-
modifyStat
-