Package net.minecraft.item
Class Item
java.lang.Object
net.minecraft.item.Item
- Direct Known Subclasses:
ArmorItem,ArmorStandItem,BedItem,BlockItem,BoatItem,BookItem,BowItem,BucketItem,CarrotOnAStickItem,CoalItem,DyeItem,EggItem,EnchantedBookItem,EnderEyeItem,EnderPearlItem,ExperienceBottleItem,FireChargeItem,FireworkChargeItem,FireworkItem,FishingRodItem,FlintAndSteelItem,FoodItem,GlassBottleItem,HoeItem,LeadItem,MilkBucketItem,MinecartItem,MusicDiscItem,NameTagItem,NetherStarItem,NetworkSyncedItem,PlaceableItem,PotionItem,RedstoneItem,SaddleItem,SeedItem,ShearsItem,SignItem,SkullItem,SnowballItem,SpawnEggItem,SwordItem,ToolItem,WallHangableItem,WoodenDoorItem,WritableBookItem,WrittenBookItem
The Item class provides useful methods and fields for creation of Items.
All items extend the Item class.
The Item class also registers all items.
- See Also:
- Mappings:
Namespace Name official zwintermediary net/minecraft/class_1069named net/minecraft/item/Item
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe ToolMaterialType enum is the basis for all tool materials. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final UUIDA map containing all BlockItems, with their corresponding Block and Item variantsprotected booleanSets whether the item has durabilityprivate ItemGroupThe Item's ItemGroupprotected booleanSets whether the item is handheldprotected intThe maximum stack size of an itemprivate intThe maximum durability of an Itemprotected static Randomprivate ItemThe item's recipe remainder.static final SimpleRegistry<Identifier,Item> The Registry where all items get registered to.private StringA description of the brewing recipe for their ingredientsprivate StringThe Item's translation key. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendItemStacks(Item item, ItemGroup group, List<ItemStack> list) Registers an item's sub itemsvoidappendTooltip(ItemStack stack, PlayerEntity player, List<String> lines, boolean advanced) static ItembyRawId(int id) Returns an Item for its numeric IdbooleanReturns whether the item can be repaired via an anvil or crafting table.booleancanUseOnEntity(ItemStack stack, PlayerEntity player, LivingEntity entity) static ItemReturns a BlockItem from a blockReturns a map containing entity attributes that are modified by the itemintgetDisplayColor(ItemStack stack, int color) getDisplayName(ItemStack stack) intReturns the enchantability of an Item.static ItemReturns an Item from its name or its numeric Id as a StringReturns the itemgroup that the item is inReturns the translated name of an ItemStackintReturns the max stack size of an ItemintReturns the maximum durability of the current Item.intgetMaxUseTime(ItemStack stack) intgetMeta(int i) floatgetMiningSpeedMultiplier(ItemStack stack, Block block) Returns the rarity of the current Item.static intReturns a numeric id for an ItemReturns the current Item's recipe remaindergetStatusEffectString(ItemStack stack) Returns the status effect string for the current item.Returns the translation key of the current ItemgetTranslationKey(ItemStack stack) getUseAction(ItemStack stack) Returns the UseAction for an item when the item is used.booleanhasEnchantmentGlint(ItemStack stack) Returns whether the current item has an enchantment glint.booleanhasStatusEffectString(ItemStack stack) Returns whether the current item has a status effect stringbooleanvoidinventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected) Runs every tick when the item is in an inventory.booleanReturns whether the current item is damageable.booleanisEffectiveOn(Block block) booleanisEnchantable(ItemStack stack) Returns whether the current item can have enchantments.booleanisFood()booleanReturns whether the item is supposed to look as handheld.booleanbooleanReturns whether the item is unbreakablebooleanonBlockBroken(ItemStack stack, World world, Block block, BlockPos pos, LivingEntity entity) voidonCraft(ItemStack stack, World world, PlayerEntity player) Runs when the item is craftedbooleanonEntityHit(ItemStack stack, LivingEntity entity1, LivingEntity entity2) onFinishUse(ItemStack stack, World world, PlayerEntity player) protected BlockHitResultonHit(World world, PlayerEntity player, boolean liquid) Returns the HitResult for an item when the player's arm is swung while holding the item.onStartUse(ItemStack stack, World world, PlayerEntity player) voidonUseStopped(ItemStack stack, World world, PlayerEntity player, int remainingTicks) booleanprivate static voidOverloaded method that registers an Item to the registryprivate static voidregister(int id, Identifier name, Item item) Registers an item to the registryprivate static voidregisterBlockItem(Block block) Overloaded method that registers a BlockItem to the registryprotected static voidregisterBlockItem(Block block, Item blockItem) Registers a BlockItem to the registrySets the item to look as handheld.setItemGroup(ItemGroup group) Sets the itemgroup that the current item should be insetMaxCount(int count) Sets the max stack size of the Itemprotected ItemsetMaxDamage(int damage) Sets the maximum durability of the current Item.setRecipeRemainder(Item recipeRemainder) Sets the item's recipe remainderprotected ItemsetStatusEffectString(String statusEffectString) Sets the status effect string for the current item.setTranslationKey(String translationKey) Sets the current item's translation key.protected ItemsetUnbreakable(boolean unbreakable) Sets the current item as unbreakable.static voidsetup()This is the main method in the Item class.booleanbooleanbooleanuse(ItemStack itemStack, PlayerEntity player, World world, BlockPos pos, Direction direction, float facingX, float facingY, float facingZ)
-
Field Details
-
REGISTRY
The Registry where all items get registered to.- Mappings:
Namespace Name Mixin selector official eLzw;e:Lcx;intermediary field_6973Lnet/minecraft/class_1069;field_6973:Lnet/minecraft/class_1943;named REGISTRYLnet/minecraft/item/Item;REGISTRY:Lnet/minecraft/util/registry/SimpleRegistry;
-
BLOCK_ITEMS
A map containing all BlockItems, with their corresponding Block and Item variants- Mappings:
Namespace Name Mixin selector official aLzw;a:Ljava/util/Map;intermediary field_12183Lnet/minecraft/class_1069;field_12183:Ljava/util/Map;named BLOCK_ITEMSLnet/minecraft/item/Item;BLOCK_ITEMS:Ljava/util/Map;
-
ATTACK_DAMAGE_MODIFIER_UUID
- Mappings:
Namespace Name Mixin selector official fLzw;f:Ljava/util/UUID;intermediary field_6947Lnet/minecraft/class_1069;field_6947:Ljava/util/UUID;named ATTACK_DAMAGE_MODIFIER_UUIDLnet/minecraft/item/Item;ATTACK_DAMAGE_MODIFIER_UUID:Ljava/util/UUID;
-
RANDOM
- Mappings:
Namespace Name Mixin selector official gLzw;g:Ljava/util/Random;intermediary field_4342Lnet/minecraft/class_1069;field_4342:Ljava/util/Random;named RANDOMLnet/minecraft/item/Item;RANDOM:Ljava/util/Random;
-
group
The Item's ItemGroup- Mappings:
Namespace Name Mixin selector official bLzw;b:Lyz;intermediary field_4247Lnet/minecraft/class_1069;field_4247:Lnet/minecraft/class_1041;named groupLnet/minecraft/item/Item;group:Lnet/minecraft/item/itemgroup/ItemGroup;
-
maxCount
protected int maxCountThe maximum stack size of an item- Mappings:
Namespace Name Mixin selector official hLzw;h:Iintermediary field_4309Lnet/minecraft/class_1069;field_4309:Inamed maxCountLnet/minecraft/item/Item;maxCount:I
-
maxDamage
private int maxDamageThe maximum durability of an Item- Mappings:
Namespace Name Mixin selector official cLzw;c:Iintermediary field_4296Lnet/minecraft/class_1069;field_4296:Inamed maxDamageLnet/minecraft/item/Item;maxDamage:I
-
handheld
protected boolean handheldSets whether the item is handheld- Mappings:
Namespace Name Mixin selector official iLzw;i:Zintermediary field_4311Lnet/minecraft/class_1069;field_4311:Znamed handheldLnet/minecraft/item/Item;handheld:Z
-
damageable
protected boolean damageableSets whether the item has durability- Mappings:
Namespace Name Mixin selector official jLzw;j:Zintermediary field_4312Lnet/minecraft/class_1069;field_4312:Znamed damageableLnet/minecraft/item/Item;damageable:Z
-
recipeRemainder
The item's recipe remainder. Used by Buckets and potions.- See Also:
- Mappings:
Namespace Name Mixin selector official dLzw;d:Lzw;intermediary field_4341Lnet/minecraft/class_1069;field_4341:Lnet/minecraft/class_1069;named recipeRemainderLnet/minecraft/item/Item;recipeRemainder:Lnet/minecraft/item/Item;
-
statusEffectString
A description of the brewing recipe for their ingredients- Mappings:
Namespace Name Mixin selector official kLzw;k:Ljava/lang/String;intermediary field_4313Lnet/minecraft/class_1069;field_4313:Ljava/lang/String;named statusEffectStringLnet/minecraft/item/Item;statusEffectString:Ljava/lang/String;
-
translationKey
The Item's translation key.- Mappings:
Namespace Name Mixin selector official lLzw;l:Ljava/lang/String;intermediary field_4314Lnet/minecraft/class_1069;field_4314:Ljava/lang/String;named translationKeyLnet/minecraft/item/Item;translationKey:Ljava/lang/String;
-
-
Constructor Details
-
Item
public Item()Sets the max stack size of an Item to 64- Mappings:
Namespace Name Mixin selector official <init>Lzw;<init>()Vintermediary <init>Lnet/minecraft/class_1069;<init>()Vnamed <init>Lnet/minecraft/item/Item;<init>()V
-
-
Method Details
-
getRawId
Returns a numeric id for an Item- Returns:
- Numeric Id
- Mappings:
Namespace Name Mixin selector official bLzw;b(Lzw;)Iintermediary method_6364Lnet/minecraft/class_1069;method_6364(Lnet/minecraft/class_1069;)Inamed getRawIdLnet/minecraft/item/Item;getRawId(Lnet/minecraft/item/Item;)I
-
byRawId
Returns an Item for its numeric Id- Returns:
- Item
- Mappings:
Namespace Name Mixin selector official bLzw;b(I)Lzw;intermediary method_6366Lnet/minecraft/class_1069;method_6366(I)Lnet/minecraft/class_1069;named byRawIdLnet/minecraft/item/Item;byRawId(I)Lnet/minecraft/item/Item;
-
fromBlock
Returns a BlockItem from a block- Returns:
- Block
- Mappings:
Namespace Name Mixin selector official aLzw;a(Lafh;)Lzw;intermediary method_6363Lnet/minecraft/class_1069;method_6363(Lnet/minecraft/class_197;)Lnet/minecraft/class_1069;named fromBlockLnet/minecraft/item/Item;fromBlock(Lnet/minecraft/block/Block;)Lnet/minecraft/item/Item;
-
getFromId
Returns an Item from its name or its numeric Id as a String- Returns:
- Item
- Mappings:
Namespace Name Mixin selector official dLzw;d(Ljava/lang/String;)Lzw;intermediary method_6325Lnet/minecraft/class_1069;method_6325(Ljava/lang/String;)Lnet/minecraft/class_1069;named getFromIdLnet/minecraft/item/Item;getFromId(Ljava/lang/String;)Lnet/minecraft/item/Item;
-
postProcessNbt
- Mappings:
Namespace Name Mixin selector official aLzw;a(Ldn;)Zintermediary method_11287Lnet/minecraft/class_1069;method_11287(Lnet/minecraft/class_322;)Znamed postProcessNbtLnet/minecraft/item/Item;postProcessNbt(Lnet/minecraft/nbt/NbtCompound;)Z
-
setMaxCount
Sets the max stack size of the Item- Parameters:
count- Maximum stack size- Returns:
- The current Item
- Mappings:
Namespace Name Mixin selector official cLzw;c(I)Lzw;intermediary method_3373Lnet/minecraft/class_1069;method_3373(I)Lnet/minecraft/class_1069;named setMaxCountLnet/minecraft/item/Item;setMaxCount(I)Lnet/minecraft/item/Item;
-
use
public boolean use(ItemStack itemStack, PlayerEntity player, World world, BlockPos pos, Direction direction, float facingX, float facingY, float facingZ) - Mappings:
Namespace Name Mixin selector official aLzw;a(Lzx;Lwn;Ladm;Lcj;Lcq;FFF)Zintermediary method_3355Lnet/minecraft/class_1069;method_3355(Lnet/minecraft/class_1071;Lnet/minecraft/class_988;Lnet/minecraft/class_1150;Lnet/minecraft/class_2552;Lnet/minecraft/class_1354;FFF)Znamed useLnet/minecraft/item/Item;use(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;FFF)Z
-
getMiningSpeedMultiplier
- Mappings:
Namespace Name Mixin selector official aLzw;a(Lzx;Lafh;)Fintermediary method_3351Lnet/minecraft/class_1069;method_3351(Lnet/minecraft/class_1071;Lnet/minecraft/class_197;)Fnamed getMiningSpeedMultiplierLnet/minecraft/item/Item;getMiningSpeedMultiplier(Lnet/minecraft/item/ItemStack;Lnet/minecraft/block/Block;)F
-
onStartUse
- Mappings:
Namespace Name Mixin selector official aLzw;a(Lzx;Ladm;Lwn;)Lzx;intermediary method_3358Lnet/minecraft/class_1069;method_3358(Lnet/minecraft/class_1071;Lnet/minecraft/class_1150;Lnet/minecraft/class_988;)Lnet/minecraft/class_1071;named onStartUseLnet/minecraft/item/Item;onStartUse(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/item/ItemStack;
-
onFinishUse
- Mappings:
Namespace Name Mixin selector official bLzw;b(Lzx;Ladm;Lwn;)Lzx;intermediary method_3367Lnet/minecraft/class_1069;method_3367(Lnet/minecraft/class_1071;Lnet/minecraft/class_1150;Lnet/minecraft/class_988;)Lnet/minecraft/class_1071;named onFinishUseLnet/minecraft/item/Item;onFinishUse(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/item/ItemStack;
-
getMaxCount
public int getMaxCount()Returns the max stack size of an Item- Returns:
- Max stack Size
- Mappings:
Namespace Name Mixin selector official jLzw;j()Iintermediary method_3382Lnet/minecraft/class_1069;method_3382()Inamed getMaxCountLnet/minecraft/item/Item;getMaxCount()I
-
getMeta
public int getMeta(int i) - Mappings:
Namespace Name Mixin selector official aLzw;a(I)Iintermediary method_3363Lnet/minecraft/class_1069;method_3363(I)Inamed getMetaLnet/minecraft/item/Item;getMeta(I)I
-
isUnbreakable
public boolean isUnbreakable()Returns whether the item is unbreakable- Returns:
- Whether the item is unbreakable
- Mappings:
Namespace Name Mixin selector official kLzw;k()Zintermediary method_3384Lnet/minecraft/class_1069;method_3384()Znamed isUnbreakableLnet/minecraft/item/Item;isUnbreakable()Z
-
setUnbreakable
Sets the current item as unbreakable.- Parameters:
unbreakable- Unbreakable- Returns:
- The current Item
- Mappings:
Namespace Name Mixin selector official aLzw;a(Z)Lzw;intermediary method_3361Lnet/minecraft/class_1069;method_3361(Z)Lnet/minecraft/class_1069;named setUnbreakableLnet/minecraft/item/Item;setUnbreakable(Z)Lnet/minecraft/item/Item;
-
getMaxDamage
public int getMaxDamage()Returns the maximum durability of the current Item.- Returns:
- Max Durability
- Mappings:
Namespace Name Mixin selector official lLzw;l()Iintermediary method_3386Lnet/minecraft/class_1069;method_3386()Inamed getMaxDamageLnet/minecraft/item/Item;getMaxDamage()I
-
setMaxDamage
Sets the maximum durability of the current Item.- Parameters:
damage- Maximum durability- Returns:
- The current Item
- Mappings:
Namespace Name Mixin selector official dLzw;d(I)Lzw;intermediary method_3376Lnet/minecraft/class_1069;method_3376(I)Lnet/minecraft/class_1069;named setMaxDamageLnet/minecraft/item/Item;setMaxDamage(I)Lnet/minecraft/item/Item;
-
isDamageable
public boolean isDamageable()Returns whether the current item is damageable. Used by tools, armor, bows, etc. -
onEntityHit
- Mappings:
Namespace Name Mixin selector official aLzw;a(Lzx;Lpr;Lpr;)Zintermediary method_3354Lnet/minecraft/class_1069;method_3354(Lnet/minecraft/class_1071;Lnet/minecraft/class_1699;Lnet/minecraft/class_1699;)Znamed onEntityHitLnet/minecraft/item/Item;onEntityHit(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/LivingEntity;)Z
-
onBlockBroken
public boolean onBlockBroken(ItemStack stack, World world, Block block, BlockPos pos, LivingEntity entity) - Mappings:
Namespace Name Mixin selector official aLzw;a(Lzx;Ladm;Lafh;Lcj;Lpr;)Zintermediary method_3356Lnet/minecraft/class_1069;method_3356(Lnet/minecraft/class_1071;Lnet/minecraft/class_1150;Lnet/minecraft/class_197;Lnet/minecraft/class_2552;Lnet/minecraft/class_1699;)Znamed onBlockBrokenLnet/minecraft/item/Item;onBlockBroken(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/block/Block;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/LivingEntity;)Z
-
isEffectiveOn
- Mappings:
Namespace Name Mixin selector official bLzw;b(Lafh;)Zintermediary method_3346Lnet/minecraft/class_1069;method_3346(Lnet/minecraft/class_197;)Znamed isEffectiveOnLnet/minecraft/item/Item;isEffectiveOn(Lnet/minecraft/block/Block;)Z
-
canUseOnEntity
- Mappings:
Namespace Name Mixin selector official aLzw;a(Lzx;Lwn;Lpr;)Zintermediary method_3353Lnet/minecraft/class_1069;method_3353(Lnet/minecraft/class_1071;Lnet/minecraft/class_988;Lnet/minecraft/class_1699;)Znamed canUseOnEntityLnet/minecraft/item/Item;canUseOnEntity(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/entity/LivingEntity;)Z
-
setHandheld
Sets the item to look as handheld.- Returns:
- The current Item
- Mappings:
Namespace Name Mixin selector official nLzw;n()Lzw;intermediary method_3389Lnet/minecraft/class_1069;method_3389()Lnet/minecraft/class_1069;named setHandheldLnet/minecraft/item/Item;setHandheld()Lnet/minecraft/item/Item;
-
isHandheld
Returns whether the item is supposed to look as handheld.- Mappings:
Namespace Name Mixin selector official w_Lzw;w_()Zintermediary method_3372Lnet/minecraft/class_1069;method_3372()Znamed isHandheldLnet/minecraft/item/Item;isHandheld()Z
-
shouldRotate
- Mappings:
Namespace Name Mixin selector official eLzw;e()Zintermediary method_3390Lnet/minecraft/class_1069;method_3390()Znamed shouldRotateLnet/minecraft/item/Item;shouldRotate()Z
-
setTranslationKey
Sets the current item's translation key.- Parameters:
translationKey- Translation key- Returns:
- The current Item
- Mappings:
Namespace Name Mixin selector official cLzw;c(Ljava/lang/String;)Lzw;intermediary method_6365Lnet/minecraft/class_1069;method_6365(Ljava/lang/String;)Lnet/minecraft/class_1069;named setTranslationKeyLnet/minecraft/item/Item;setTranslationKey(Ljava/lang/String;)Lnet/minecraft/item/Item;
-
getItemstackTranslatedName
Returns the translated name of an ItemStack- Parameters:
stack- The ItemStack- Returns:
- Translated name
- See Also:
- Mappings:
Namespace Name Mixin selector official kLzw;k(Lzx;)Ljava/lang/String;intermediary method_3379Lnet/minecraft/class_1069;method_3379(Lnet/minecraft/class_1071;)Ljava/lang/String;named getItemstackTranslatedNameLnet/minecraft/item/Item;getItemstackTranslatedName(Lnet/minecraft/item/ItemStack;)Ljava/lang/String;
-
getTranslationKey
Returns the translation key of the current Item- Returns:
- Translation key
- Mappings:
Namespace Name Mixin selector official aLzw;a()Ljava/lang/String;intermediary method_3342Lnet/minecraft/class_1069;method_3342()Ljava/lang/String;named getTranslationKeyLnet/minecraft/item/Item;getTranslationKey()Ljava/lang/String;
-
getTranslationKey
- Mappings:
Namespace Name Mixin selector official e_Lzw;e_(Lzx;)Ljava/lang/String;intermediary method_3371Lnet/minecraft/class_1069;method_3371(Lnet/minecraft/class_1071;)Ljava/lang/String;named getTranslationKeyLnet/minecraft/item/Item;getTranslationKey(Lnet/minecraft/item/ItemStack;)Ljava/lang/String;
-
setRecipeRemainder
Sets the item's recipe remainder- Returns:
- The current Item
- Mappings:
Namespace Name Mixin selector official cLzw;c(Lzw;)Lzw;intermediary method_3349Lnet/minecraft/class_1069;method_3349(Lnet/minecraft/class_1069;)Lnet/minecraft/class_1069;named setRecipeRemainderLnet/minecraft/item/Item;setRecipeRemainder(Lnet/minecraft/item/Item;)Lnet/minecraft/item/Item;
-
shouldSyncNbtToClient
public boolean shouldSyncNbtToClient()- Mappings:
Namespace Name Mixin selector official pLzw;p()Zintermediary method_3391Lnet/minecraft/class_1069;method_3391()Znamed shouldSyncNbtToClientLnet/minecraft/item/Item;shouldSyncNbtToClient()Z
-
getRecipeRemainder
Returns the current Item's recipe remainder- Returns:
- recipeRemainder
- Mappings:
Namespace Name Mixin selector official qLzw;q()Lzw;intermediary method_3392Lnet/minecraft/class_1069;method_3392()Lnet/minecraft/class_1069;named getRecipeRemainderLnet/minecraft/item/Item;getRecipeRemainder()Lnet/minecraft/item/Item;
-
isFood
public boolean isFood()- Mappings:
Namespace Name Mixin selector official rLzw;r()Zintermediary method_3393Lnet/minecraft/class_1069;method_3393()Znamed isFoodLnet/minecraft/item/Item;isFood()Z
-
getDisplayColor
- Mappings:
Namespace Name Mixin selector official aLzw;a(Lzx;I)Iintermediary method_3344Lnet/minecraft/class_1069;method_3344(Lnet/minecraft/class_1071;I)Inamed getDisplayColorLnet/minecraft/item/Item;getDisplayColor(Lnet/minecraft/item/ItemStack;I)I
-
inventoryTick
Runs every tick when the item is in an inventory.- Parameters:
stack- The item in an ItemStack formworld- The world where the item is tickingentity- The entity whose inventory contains the itemslot- The slot in which the item is placedselected- Whether the item is currently selected by the entity- Mappings:
Namespace Name Mixin selector official aLzw;a(Lzx;Ladm;Lpk;IZ)Vintermediary method_3357Lnet/minecraft/class_1069;method_3357(Lnet/minecraft/class_1071;Lnet/minecraft/class_1150;Lnet/minecraft/class_864;IZ)Vnamed inventoryTickLnet/minecraft/item/Item;inventoryTick(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/entity/Entity;IZ)V
-
onCraft
Runs when the item is crafted- Parameters:
stack- The item in an ItemStack formworld- The world where the crafting happenedplayer- The player who crafted the item- Mappings:
Namespace Name Mixin selector official dLzw;d(Lzx;Ladm;Lwn;)Vintermediary method_3375Lnet/minecraft/class_1069;method_3375(Lnet/minecraft/class_1071;Lnet/minecraft/class_1150;Lnet/minecraft/class_988;)Vnamed onCraftLnet/minecraft/item/Item;onCraft(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;)V
-
isNetworkSynced
public boolean isNetworkSynced()- Mappings:
Namespace Name Mixin selector official fLzw;f()Zintermediary method_3388Lnet/minecraft/class_1069;method_3388()Znamed isNetworkSyncedLnet/minecraft/item/Item;isNetworkSynced()Z
-
getUseAction
Returns the UseAction for an item when the item is used. Used by food, potions, bows, etc.- Parameters:
stack- The ItemStack that was used- See Also:
- Mappings:
Namespace Name Mixin selector official eLzw;e(Lzx;)Laba;intermediary method_3366Lnet/minecraft/class_1069;method_3366(Lnet/minecraft/class_1071;)Lnet/minecraft/class_1099;named getUseActionLnet/minecraft/item/Item;getUseAction(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/util/UseAction;
-
getMaxUseTime
- Mappings:
Namespace Name Mixin selector official dLzw;d(Lzx;)Iintermediary method_3350Lnet/minecraft/class_1069;method_3350(Lnet/minecraft/class_1071;)Inamed getMaxUseTimeLnet/minecraft/item/Item;getMaxUseTime(Lnet/minecraft/item/ItemStack;)I
-
onUseStopped
- Mappings:
Namespace Name Mixin selector official aLzw;a(Lzx;Ladm;Lwn;I)Vintermediary method_3359Lnet/minecraft/class_1069;method_3359(Lnet/minecraft/class_1071;Lnet/minecraft/class_1150;Lnet/minecraft/class_988;I)Vnamed onUseStoppedLnet/minecraft/item/Item;onUseStopped(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;I)V
-
setStatusEffectString
Sets the status effect string for the current item. Used by glowstone, spider eye, sugar, etc.- Parameters:
statusEffectString- The status effect string- Returns:
- The current Item
- Mappings:
Namespace Name Mixin selector official eLzw;e(Ljava/lang/String;)Lzw;intermediary method_3370Lnet/minecraft/class_1069;method_3370(Ljava/lang/String;)Lnet/minecraft/class_1069;named setStatusEffectStringLnet/minecraft/item/Item;setStatusEffectString(Ljava/lang/String;)Lnet/minecraft/item/Item;
-
getStatusEffectString
Returns the status effect string for the current item.- Returns:
- The status effect string
- Mappings:
Namespace Name Mixin selector official jLzw;j(Lzx;)Ljava/lang/String;intermediary method_6367Lnet/minecraft/class_1069;method_6367(Lnet/minecraft/class_1071;)Ljava/lang/String;named getStatusEffectStringLnet/minecraft/item/Item;getStatusEffectString(Lnet/minecraft/item/ItemStack;)Ljava/lang/String;
-
hasStatusEffectString
Returns whether the current item has a status effect string- Returns:
- Whether the current item has a status effect string
- Mappings:
Namespace Name Mixin selector official lLzw;l(Lzx;)Zintermediary method_6369Lnet/minecraft/class_1069;method_6369(Lnet/minecraft/class_1071;)Znamed hasStatusEffectStringLnet/minecraft/item/Item;hasStatusEffectString(Lnet/minecraft/item/ItemStack;)Z
-
appendTooltip
@Environment(CLIENT) public void appendTooltip(ItemStack stack, PlayerEntity player, List<String> lines, boolean advanced) - Mappings:
Namespace Name Mixin selector official aLzw;a(Lzx;Lwn;Ljava/util/List;Z)Vintermediary method_3352Lnet/minecraft/class_1069;method_3352(Lnet/minecraft/class_1071;Lnet/minecraft/class_988;Ljava/util/List;Z)Vnamed appendTooltipLnet/minecraft/item/Item;appendTooltip(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/player/PlayerEntity;Ljava/util/List;Z)V
-
getDisplayName
- Mappings:
Namespace Name Mixin selector official aLzw;a(Lzx;)Ljava/lang/String;intermediary method_3383Lnet/minecraft/class_1069;method_3383(Lnet/minecraft/class_1071;)Ljava/lang/String;named getDisplayNameLnet/minecraft/item/Item;getDisplayName(Lnet/minecraft/item/ItemStack;)Ljava/lang/String;
-
hasEnchantmentGlint
Returns whether the current item has an enchantment glint. Used by enchanted golden apples and enchanted items.- See Also:
-
net.minecraft.item.GoldenAppleItem
- Mappings:
Namespace Name Mixin selector official fLzw;f(Lzx;)Zintermediary method_3374Lnet/minecraft/class_1069;method_3374(Lnet/minecraft/class_1071;)Znamed hasEnchantmentGlintLnet/minecraft/item/Item;hasEnchantmentGlint(Lnet/minecraft/item/ItemStack;)Z
-
getRarity
Returns the rarity of the current Item. Used by golden apples, enchanted items and potions.- Parameters:
stack- The item in an ItemStack form- Returns:
- The rarity of the ItemStack
- See Also:
-
net.minecraft.item.GoldenAppleItemPotionItem
- Mappings:
Namespace Name Mixin selector official gLzw;g(Lzx;)Laaj;intermediary method_3377Lnet/minecraft/class_1069;method_3377(Lnet/minecraft/class_1071;)Lnet/minecraft/class_1081;named getRarityLnet/minecraft/item/Item;getRarity(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/util/Rarity;
-
isEnchantable
Returns whether the current item can have enchantments. It does this by verifying that the item's maximum stack size is 1 and the item can break.- Mappings:
Namespace Name Mixin selector official f_Lzw;f_(Lzx;)Zintermediary method_3385Lnet/minecraft/class_1069;method_3385(Lnet/minecraft/class_1071;)Znamed isEnchantableLnet/minecraft/item/Item;isEnchantable(Lnet/minecraft/item/ItemStack;)Z
-
onHit
Returns the HitResult for an item when the player's arm is swung while holding the item.- Parameters:
world- The world that the item is inplayer- The player holding the item- Returns:
- HitResult
- Mappings:
Namespace Name Mixin selector official aLzw;a(Ladm;Lwn;Z)Lauh;intermediary method_3360Lnet/minecraft/class_1069;method_3360(Lnet/minecraft/class_1150;Lnet/minecraft/class_988;Z)Lnet/minecraft/class_234;named onHitLnet/minecraft/item/Item;onHit(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;Z)Lnet/minecraft/util/hit/BlockHitResult;
-
getEnchantability
public int getEnchantability()Returns the enchantability of an Item. Used by tools and armor -
appendItemStacks
Registers an item's sub items- Parameters:
item- The Item instancegroup- The ItemGrouplist- The list of sub items- Mappings:
Namespace Name Mixin selector official aLzw;a(Lzw;Lyz;Ljava/util/List;)Vintermediary method_3345Lnet/minecraft/class_1069;method_3345(Lnet/minecraft/class_1069;Lnet/minecraft/class_1041;Ljava/util/List;)Vnamed appendItemStacksLnet/minecraft/item/Item;appendItemStacks(Lnet/minecraft/item/Item;Lnet/minecraft/item/itemgroup/ItemGroup;Ljava/util/List;)V
-
getItemGroup
Returns the itemgroup that the item is in- Mappings:
Namespace Name Mixin selector official cLzw;c()Lyz;intermediary method_3398Lnet/minecraft/class_1069;method_3398()Lnet/minecraft/class_1041;named getItemGroupLnet/minecraft/item/Item;getItemGroup()Lnet/minecraft/item/itemgroup/ItemGroup;
-
setItemGroup
Sets the itemgroup that the current item should be in- Parameters:
group- The ItemGroup- Returns:
- The current Item
- Mappings:
Namespace Name Mixin selector official aLzw;a(Lyz;)Lzw;intermediary method_3348Lnet/minecraft/class_1069;method_3348(Lnet/minecraft/class_1041;)Lnet/minecraft/class_1069;named setItemGroupLnet/minecraft/item/Item;setItemGroup(Lnet/minecraft/item/itemgroup/ItemGroup;)Lnet/minecraft/item/Item;
-
hasSubTypes
public boolean hasSubTypes()- Mappings:
Namespace Name Mixin selector official sLzw;s()Zintermediary method_4616Lnet/minecraft/class_1069;method_4616()Znamed hasSubTypesLnet/minecraft/item/Item;hasSubTypes()Z
-
canRepair
Returns whether the item can be repaired via an anvil or crafting table.- Mappings:
Namespace Name Mixin selector official aLzw;a(Lzx;Lzx;)Zintermediary method_4615Lnet/minecraft/class_1069;method_4615(Lnet/minecraft/class_1071;Lnet/minecraft/class_1071;)Znamed canRepairLnet/minecraft/item/Item;canRepair(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Z
-
getAttributeModifierMap
Returns a map containing entity attributes that are modified by the item- Mappings:
Namespace Name Mixin selector official iLzw;i()Lcom/google/common/collect/Multimap;intermediary method_6326Lnet/minecraft/class_1069;method_6326()Lcom/google/common/collect/Multimap;named getAttributeModifierMapLnet/minecraft/item/Item;getAttributeModifierMap()Lcom/google/common/collect/Multimap;
-
setup
public static void setup()This is the main method in the Item class. Both Items and BlockItems get registered here. The Item Ids starts from 256. The fields in the class Items can not be accessed before this method is called.- See Also:
- Mappings:
Namespace Name Mixin selector official tLzw;t()Vintermediary method_6368Lnet/minecraft/class_1069;method_6368()Vnamed setupLnet/minecraft/item/Item;setup()V
-
registerBlockItem
Overloaded method that registers a BlockItem to the registry- Parameters:
block- The block- Mappings:
Namespace Name Mixin selector official cLzw;c(Lafh;)Vintermediary method_11288Lnet/minecraft/class_1069;method_11288(Lnet/minecraft/class_197;)Vnamed registerBlockItemLnet/minecraft/item/Item;registerBlockItem(Lnet/minecraft/block/Block;)V
-
registerBlockItem
Registers a BlockItem to the registry- Parameters:
block- The BlockblockItem- The BlockItem- Mappings:
Namespace Name Mixin selector official aLzw;a(Lafh;Lzw;)Vintermediary method_11286Lnet/minecraft/class_1069;method_11286(Lnet/minecraft/class_197;Lnet/minecraft/class_1069;)Vnamed registerBlockItemLnet/minecraft/item/Item;registerBlockItem(Lnet/minecraft/block/Block;Lnet/minecraft/item/Item;)V
-
register
Overloaded method that registers an Item to the registry- Parameters:
id- The Item Idname- The Item's nameitem- The item to be registered- Mappings:
Namespace Name Mixin selector official aLzw;a(ILjava/lang/String;Lzw;)Vintermediary method_11284Lnet/minecraft/class_1069;method_11284(ILjava/lang/String;Lnet/minecraft/class_1069;)Vnamed registerLnet/minecraft/item/Item;register(ILjava/lang/String;Lnet/minecraft/item/Item;)V
-
register
Registers an item to the registry- Parameters:
id- The Item Idname- The Item's identifieritem- The Item to be registered- Mappings:
Namespace Name Mixin selector official aLzw;a(ILjy;Lzw;)Vintermediary method_11285Lnet/minecraft/class_1069;method_11285(ILnet/minecraft/class_1653;Lnet/minecraft/class_1069;)Vnamed registerLnet/minecraft/item/Item;register(ILnet/minecraft/util/Identifier;Lnet/minecraft/item/Item;)V
-