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,class_2680,class_3056,class_3187,ClockItem,CoalItem,CompassItem,DyeItem,EggItem,ElytraItem,EnchantedBookItem,EndCrystalItem,EnderEyeItem,EnderPearlItem,ExperienceBottleItem,FireChargeItem,FireworkChargeItem,FireworkItem,FishingRodItem,FlintAndSteelItem,FoodItem,GlassBottleItem,HoeItem,LeadItem,MilkBucketItem,MinecartItem,MusicDiscItem,NameTagItem,NetherStarItem,NetworkSyncedItem,PlaceableItem,PotionItem,RedstoneItem,SaddleItem,SeedItem,ShearsItem,ShieldItem,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 ainintermediary 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 UUIDprotected static final UUIDA map containing all BlockItems, with their corresponding Block and Item variantsprotected booleanSets whether the item has durabilityprivate final Registry<Identifier,ItemPropertyGetter> private static final ItemPropertyGetterprivate static final ItemPropertyGetterprivate static final ItemPropertyGetterprivate static final ItemPropertyGetterprivate 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 StringThe Item's translation key. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddProperty(Identifier identifier, ItemPropertyGetter itemPropertyGetter) voidappendToItemGroup(ItemGroup group, DefaultedList<ItemStack> stacks) voidappendTooltips(ItemStack stack, World world, List<String> tooltip, TooltipContext tooltipContext) static ItembyRawId(int id) Returns an Item for its numeric Idprotected booleanbooleanReturns whether the item can be repaired via an anvil or crafting table.static ItemReturns a BlockItem from a blockfloatgetBlockBreakingSpeed(ItemStack stack, BlockState state) 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) getProperty(Identifier identifier) Returns the rarity of the current Item.static intReturns a numeric id for an ItemReturns the current Item's recipe remainderReturns 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.booleanbooleanvoidinventoryTick(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.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 unbreakablemethod_13649(World world, PlayerEntity player, Hand hand) booleanmethod_3346(BlockState blockState) booleanmethod_3353(ItemStack itemStack, PlayerEntity playerEntity, LivingEntity livingEntity, Hand hand) booleanmethod_3356(ItemStack itemStack, World world, BlockState blockState, BlockPos blockPos, LivingEntity livingEntity) voidmethod_3359(ItemStack stack, World world, LivingEntity entity, int int2) method_3367(ItemStack stack, World world, LivingEntity entity) method_6326(EquipmentSlot equipmentSlot) voidonCraft(ItemStack stack, World world, PlayerEntity player) Runs when the item is craftedbooleanonEntityHit(ItemStack stack, LivingEntity entity1, LivingEntity entity2) 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.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 remaindersetTranslationKey(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.booleanbooleanuse(PlayerEntity player, World world, BlockPos pos, Hand hand, Direction direction, float x, float y, float z)
-
Field Details
-
REGISTRY
The Registry where all items get registered to.- Mappings:
Namespace Name Mixin selector official gLain;g:Lfh;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 aLain;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;
-
GETTER_DAMAGED
- Mappings:
Namespace Name Mixin selector official bLain;b:Laiq;intermediary field_12299Lnet/minecraft/class_1069;field_12299:Lnet/minecraft/class_2688;named GETTER_DAMAGEDLnet/minecraft/item/Item;GETTER_DAMAGED:Lnet/minecraft/item/ItemPropertyGetter;
-
GETTER_DAMAGE
- Mappings:
Namespace Name Mixin selector official cLain;c:Laiq;intermediary field_12300Lnet/minecraft/class_1069;field_12300:Lnet/minecraft/class_2688;named GETTER_DAMAGELnet/minecraft/item/Item;GETTER_DAMAGE:Lnet/minecraft/item/ItemPropertyGetter;
-
GETTER_HAND
- Mappings:
Namespace Name Mixin selector official dLain;d:Laiq;intermediary field_12301Lnet/minecraft/class_1069;field_12301:Lnet/minecraft/class_2688;named GETTER_HANDLnet/minecraft/item/Item;GETTER_HAND:Lnet/minecraft/item/ItemPropertyGetter;
-
GETTER_COOLDOWN
- Mappings:
Namespace Name Mixin selector official eLain;e:Laiq;intermediary field_12302Lnet/minecraft/class_1069;field_12302:Lnet/minecraft/class_2688;named GETTER_COOLDOWNLnet/minecraft/item/Item;GETTER_COOLDOWN:Lnet/minecraft/item/ItemPropertyGetter;
-
ATTACK_DAMAGE_MODIFIER_UUID
- Mappings:
Namespace Name Mixin selector official hLain;h: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;
-
ATTACK_SPEED_MODIFIER
- Mappings:
Namespace Name Mixin selector official iLain;i:Ljava/util/UUID;intermediary field_12304Lnet/minecraft/class_1069;field_12304:Ljava/util/UUID;named ATTACK_SPEED_MODIFIERLnet/minecraft/item/Item;ATTACK_SPEED_MODIFIER:Ljava/util/UUID;
-
RANDOM
- Mappings:
Namespace Name Mixin selector official jLain;j:Ljava/util/Random;intermediary field_4342Lnet/minecraft/class_1069;field_4342:Ljava/util/Random;named RANDOMLnet/minecraft/item/Item;RANDOM:Ljava/util/Random;
-
field_12303
- Mappings:
Namespace Name Mixin selector official fLain;f:Lfm;intermediary field_12303Lnet/minecraft/class_1069;field_12303:Lnet/minecraft/class_1366;named field_12303Lnet/minecraft/item/Item;field_12303:Lnet/minecraft/util/registry/Registry;
-
group
The Item's ItemGroup- Mappings:
Namespace Name Mixin selector official nLain;n:Lahp;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 kLain;k: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 oLain;o: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 lLain;l: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 mLain;m: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 pLain;p:Lain;intermediary field_4341Lnet/minecraft/class_1069;field_4341:Lnet/minecraft/class_1069;named recipeRemainderLnet/minecraft/item/Item;recipeRemainder:Lnet/minecraft/item/Item;
-
translationKey
The Item's translation key.- Mappings:
Namespace Name Mixin selector official qLain;q: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>Lain;<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 aLain;a(Lain;)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 cLain;c(I)Lain;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 aLain;a(Laow;)Lain;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 bLain;b(Ljava/lang/String;)Lain;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;
-
addProperty
- Mappings:
Namespace Name Mixin selector official aLain;a(Lnf;Laiq;)Vintermediary method_11375Lnet/minecraft/class_1069;method_11375(Lnet/minecraft/class_1653;Lnet/minecraft/class_2688;)Vnamed addPropertyLnet/minecraft/item/Item;addProperty(Lnet/minecraft/util/Identifier;Lnet/minecraft/item/ItemPropertyGetter;)V
-
getProperty
- Mappings:
Namespace Name Mixin selector official aLain;a(Lnf;)Laiq;intermediary method_11374Lnet/minecraft/class_1069;method_11374(Lnet/minecraft/class_1653;)Lnet/minecraft/class_2688;named getPropertyLnet/minecraft/item/Item;getProperty(Lnet/minecraft/util/Identifier;)Lnet/minecraft/item/ItemPropertyGetter;
-
hasProperties
- Mappings:
Namespace Name Mixin selector official iLain;i()Zintermediary method_11376Lnet/minecraft/class_1069;method_11376()Znamed hasPropertiesLnet/minecraft/item/Item;hasProperties()Z
-
postProcessNbt
- Mappings:
Namespace Name Mixin selector official aLain;a(Lfy;)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 dLain;d(I)Lain;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 ActionResult use(PlayerEntity player, World world, BlockPos pos, Hand hand, Direction direction, float x, float y, float z) - Mappings:
Namespace Name Mixin selector official aLain;a(Laed;Lamu;Let;Lub;Lfa;FFF)Lud;intermediary method_3355Lnet/minecraft/class_1069;method_3355(Lnet/minecraft/class_988;Lnet/minecraft/class_1150;Lnet/minecraft/class_2552;Lnet/minecraft/class_2961;Lnet/minecraft/class_1354;FFF)Lnet/minecraft/class_2962;named useLnet/minecraft/item/Item;use(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/Hand;Lnet/minecraft/util/math/Direction;FFF)Lnet/minecraft/util/ActionResult;
-
getBlockBreakingSpeed
- Mappings:
Namespace Name Mixin selector official aLain;a(Laip;Lawt;)Fintermediary method_3351Lnet/minecraft/class_1069;method_3351(Lnet/minecraft/class_1071;Lnet/minecraft/class_2232;)Fnamed getBlockBreakingSpeedLnet/minecraft/item/Item;getBlockBreakingSpeed(Lnet/minecraft/item/ItemStack;Lnet/minecraft/block/BlockState;)F
-
method_13649
- Mappings:
Namespace Name Mixin selector official aLain;a(Lamu;Laed;Lub;)Lue;intermediary method_13649Lnet/minecraft/class_1069;method_13649(Lnet/minecraft/class_1150;Lnet/minecraft/class_988;Lnet/minecraft/class_2961;)Lnet/minecraft/class_2963;named method_13649Lnet/minecraft/item/Item;method_13649(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;)Lnet/minecraft/util/TypedActionResult;
-
method_3367
- Mappings:
Namespace Name Mixin selector official aLain;a(Laip;Lamu;Lvp;)Laip;intermediary method_3367Lnet/minecraft/class_1069;method_3367(Lnet/minecraft/class_1071;Lnet/minecraft/class_1150;Lnet/minecraft/class_1699;)Lnet/minecraft/class_1071;named method_3367Lnet/minecraft/item/Item;method_3367(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/entity/LivingEntity;)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 jLain;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 aLain;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 kLain;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 aLain;a(Z)Lain;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 lLain;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 eLain;e(I)Lain;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 aLain;a(Laip;Lvp;Lvp;)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
-
method_3356
public boolean method_3356(ItemStack itemStack, World world, BlockState blockState, BlockPos blockPos, LivingEntity livingEntity) - Mappings:
Namespace Name Mixin selector official aLain;a(Laip;Lamu;Lawt;Let;Lvp;)Zintermediary method_3356Lnet/minecraft/class_1069;method_3356(Lnet/minecraft/class_1071;Lnet/minecraft/class_1150;Lnet/minecraft/class_2232;Lnet/minecraft/class_2552;Lnet/minecraft/class_1699;)Znamed method_3356Lnet/minecraft/item/Item;method_3356(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/LivingEntity;)Z
-
method_3346
- Mappings:
Namespace Name Mixin selector official aLain;a(Lawt;)Zintermediary method_3346Lnet/minecraft/class_1069;method_3346(Lnet/minecraft/class_2232;)Znamed method_3346Lnet/minecraft/item/Item;method_3346(Lnet/minecraft/block/BlockState;)Z
-
method_3353
public boolean method_3353(ItemStack itemStack, PlayerEntity playerEntity, LivingEntity livingEntity, Hand hand) - Mappings:
Namespace Name Mixin selector official aLain;a(Laip;Laed;Lvp;Lub;)Zintermediary method_3353Lnet/minecraft/class_1069;method_3353(Lnet/minecraft/class_1071;Lnet/minecraft/class_988;Lnet/minecraft/class_1699;Lnet/minecraft/class_2961;)Znamed method_3353Lnet/minecraft/item/Item;method_3353(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/util/Hand;)Z
-
setHandheld
Sets the item to look as handheld.- Returns:
- The current Item
- Mappings:
Namespace Name Mixin selector official nLain;n()Lain;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 D_Lain;D_()Zintermediary method_3372Lnet/minecraft/class_1069;method_3372()Znamed isHandheldLnet/minecraft/item/Item;isHandheld()Z
-
shouldRotate
- Mappings:
Namespace Name Mixin selector official F_Lain;F_()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 cLain;c(Ljava/lang/String;)Lain;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 jLain;j(Laip;)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 aLain;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 aLain;a(Laip;)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 bLain;b(Lain;)Lain;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 pLain;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 qLain;q()Lain;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 rLain;r()Zintermediary method_3393Lnet/minecraft/class_1069;method_3393()Znamed isFoodLnet/minecraft/item/Item;isFood()Z
-
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 aLain;a(Laip;Lamu;Lvg;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 bLain;b(Laip;Lamu;Laed;)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 fLain;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 fLain;f(Laip;)Lakc;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 eLain;e(Laip;)Iintermediary method_3350Lnet/minecraft/class_1069;method_3350(Lnet/minecraft/class_1071;)Inamed getMaxUseTimeLnet/minecraft/item/Item;getMaxUseTime(Lnet/minecraft/item/ItemStack;)I
-
method_3359
- Mappings:
Namespace Name Mixin selector official aLain;a(Laip;Lamu;Lvp;I)Vintermediary method_3359Lnet/minecraft/class_1069;method_3359(Lnet/minecraft/class_1071;Lnet/minecraft/class_1150;Lnet/minecraft/class_1699;I)Vnamed method_3359Lnet/minecraft/item/Item;method_3359(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/entity/LivingEntity;I)V
-
appendTooltips
@Environment(CLIENT) public void appendTooltips(ItemStack stack, @Nullable World world, List<String> tooltip, TooltipContext tooltipContext) - Mappings:
Namespace Name Mixin selector official aLain;a(Laip;Lamu;Ljava/util/List;Lakb;)Vintermediary method_14234Lnet/minecraft/class_1069;method_14234(Lnet/minecraft/class_1071;Lnet/minecraft/class_1150;Ljava/util/List;Lnet/minecraft/class_3191;)Vnamed appendTooltipsLnet/minecraft/item/Item;appendTooltips(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Ljava/util/List;Lnet/minecraft/client/TooltipContext;)V
-
getDisplayName
- Mappings:
Namespace Name Mixin selector official bLain;b(Laip;)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 f_Lain;f_(Laip;)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 gLain;g(Laip;)Laje;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 g_Lain;g_(Laip;)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 aLain;a(Lamu;Laed;Z)Lbhc;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 -
appendToItemGroup
- Mappings:
Namespace Name Mixin selector official aLain;a(Lahp;Lfi;)Vintermediary method_14233Lnet/minecraft/class_1069;method_14233(Lnet/minecraft/class_1041;Lnet/minecraft/class_3114;)Vnamed appendToItemGroupLnet/minecraft/item/Item;appendToItemGroup(Lnet/minecraft/item/itemgroup/ItemGroup;Lnet/minecraft/util/collection/DefaultedList;)V
-
canAddTo
- Mappings:
Namespace Name Mixin selector official aLain;a(Lahp;)Zintermediary method_14232Lnet/minecraft/class_1069;method_14232(Lnet/minecraft/class_1041;)Znamed canAddToLnet/minecraft/item/Item;canAddTo(Lnet/minecraft/item/itemgroup/ItemGroup;)Z
-
getItemGroup
Returns the itemgroup that the item is in- Mappings:
Namespace Name Mixin selector official bLain;b()Lahp;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 bLain;b(Lahp;)Lain;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 sLain;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 aLain;a(Laip;Laip;)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
-
method_6326
- Mappings:
Namespace Name Mixin selector official aLain;a(Lvl;)Lcom/google/common/collect/Multimap;intermediary method_6326Lnet/minecraft/class_1069;method_6326(Lnet/minecraft/class_2968;)Lcom/google/common/collect/Multimap;named method_6326Lnet/minecraft/item/Item;method_6326(Lnet/minecraft/entity/EquipmentSlot;)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 tLain;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 bLain;b(Laow;)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 aLain;a(Laow;Lain;)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 aLain;a(ILjava/lang/String;Lain;)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 aLain;a(ILnf;Lain;)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
-
getDefaultStack
- Mappings:
Namespace Name Mixin selector official uLain;u()Laip;intermediary method_13650Lnet/minecraft/class_1069;method_13650()Lnet/minecraft/class_1071;named getDefaultStackLnet/minecraft/item/Item;getDefaultStack()Lnet/minecraft/item/ItemStack;
-