Class ItemHelper
java.lang.Object
com.pixelmonmod.pixelmon.items.helpers.ItemHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.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.static net.minecraft.world.item.Item
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.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.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.static net.minecraft.world.item.Item
static net.minecraft.world.item.Item
getResistanceBerry
(Element type) 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.static boolean
hasTag
(net.minecraft.world.item.ItemStack itemStack) Deprecated, for removal: This API element is subject to removal in a future version.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.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.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.
-
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. -
getResistanceBerry
-
getPlate
-
getGem
-
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.
-