Class ItemHelper
java.lang.Object
com.pixelmonmod.pixelmon.items.helpers.ItemHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidenchantIfPossible(net.minecraft.world.item.ItemStack stack, net.minecraft.core.Holder<net.minecraft.world.item.enchantment.Enchantment> enchantment, int tier) Enchant an item, but only if it hasn't been enchanted with this method before.static voidenchantIfPossible(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.enchantment.Enchantment[] enchantments, int[] tiers) Enchant an item, but only if it hasn't been enchanted with this method before.static voidgetOrCreateAndModifyTag(net.minecraft.world.item.ItemStack itemStack, Consumer<net.minecraft.nbt.CompoundTag> modifier) Deprecated, for removal: This API element is subject to removal in a future version.static net.minecraft.nbt.CompoundTaggetOrCreateTag(net.minecraft.world.item.ItemStack itemStack) Deprecated, for removal: This API element is subject to removal in a future version.static net.minecraft.nbt.CompoundTaggetOrCreateTagElement(net.minecraft.world.item.ItemStack itemStack, String key) Deprecated, for removal: This API element is subject to removal in a future version.static net.minecraft.nbt.CompoundTaggetTag(net.minecraft.world.item.ItemStack itemStack) Deprecated, for removal: This API element is subject to removal in a future version.static booleanhasTag(net.minecraft.world.item.ItemStack itemStack) Deprecated, for removal: This API element is subject to removal in a future version.static voidmodifyTagIfPresent(net.minecraft.world.item.ItemStack itemStack, Consumer<net.minecraft.nbt.CompoundTag> modifier) Deprecated, for removal: This API element is subject to removal in a future version.static voidsetTag(net.minecraft.world.item.ItemStack itemStack, net.minecraft.nbt.CompoundTag tag) Deprecated, for removal: This API element is subject to removal in a future version.static booleantestTag(net.minecraft.world.item.ItemStack itemStack, Predicate<net.minecraft.nbt.CompoundTag> predicate) Deprecated, for removal: This API element is subject to removal in a future version.
-
Constructor Details
-
ItemHelper
public ItemHelper()
-
-
Method Details
-
testTag
@Deprecated(forRemoval=true) public static boolean testTag(net.minecraft.world.item.ItemStack itemStack, Predicate<net.minecraft.nbt.CompoundTag> predicate) Deprecated, for removal: This API element is subject to removal in a future version. -
hasTag
@Deprecated(forRemoval=true) public static boolean hasTag(net.minecraft.world.item.ItemStack itemStack) Deprecated, for removal: This API element is subject to removal in a future version. -
getTag
@Deprecated(forRemoval=true) public static net.minecraft.nbt.CompoundTag getTag(net.minecraft.world.item.ItemStack itemStack) Deprecated, for removal: This API element is subject to removal in a future version. -
getOrCreateTag
@Deprecated(forRemoval=true) public static net.minecraft.nbt.CompoundTag getOrCreateTag(net.minecraft.world.item.ItemStack itemStack) Deprecated, for removal: This API element is subject to removal in a future version. -
getOrCreateTagElement
@Deprecated(forRemoval=true) public static net.minecraft.nbt.CompoundTag getOrCreateTagElement(net.minecraft.world.item.ItemStack itemStack, String key) Deprecated, for removal: This API element is subject to removal in a future version. -
setTag
@Deprecated(forRemoval=true) public static void setTag(net.minecraft.world.item.ItemStack itemStack, net.minecraft.nbt.CompoundTag tag) Deprecated, for removal: This API element is subject to removal in a future version. -
modifyTagIfPresent
@Deprecated(forRemoval=true) public static void modifyTagIfPresent(net.minecraft.world.item.ItemStack itemStack, Consumer<net.minecraft.nbt.CompoundTag> modifier) Deprecated, for removal: This API element is subject to removal in a future version. -
getOrCreateAndModifyTag
@Deprecated(forRemoval=true) public static void getOrCreateAndModifyTag(net.minecraft.world.item.ItemStack itemStack, Consumer<net.minecraft.nbt.CompoundTag> modifier) Deprecated, for removal: This API element is subject to removal in a future version. -
enchantIfPossible
public static void enchantIfPossible(net.minecraft.world.item.ItemStack stack, net.minecraft.core.Holder<net.minecraft.world.item.enchantment.Enchantment> enchantment, int tier) Enchant an item, but only if it hasn't been enchanted with this method before.- Parameters:
stack- The item to be enchanted.enchantment- The enchantment to be applied.tier- The tier of the enchantment to be applied.
-
enchantIfPossible
public static void enchantIfPossible(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.enchantment.Enchantment[] enchantments, int[] tiers) Enchant an item, but only if it hasn't been enchanted with this method before.- Parameters:
stack- The item to be enchanted.enchantments- The enchantments to be applied.tiers- The tiers of the enchantments to be applied.
-