mirror of https://github.com/FabricMC/yarn.git
468 lines
25 KiB
Plaintext
468 lines
25 KiB
Plaintext
CLASS net/minecraft/class_1792 net/minecraft/item/Item
|
|
COMMENT An item usable by players and other entities.
|
|
COMMENT
|
|
COMMENT <p>Like {@link Block}, this class handles logics for a type of item, and does not
|
|
COMMENT hold any data. Any data about a particular stack of item in a world, such as item count,
|
|
COMMENT is held by an {@link ItemStack} which represents a stack of specific item. Therefore,
|
|
COMMENT there is one - and only one - instance of Item for one item (like apples, oak planks, etc),
|
|
COMMENT while there can be infinite amounts of {@link ItemStack} instances. This also means that
|
|
COMMENT items themselves cannot hold NBT data. To append item stacks with NBT data to the
|
|
COMMENT creative inventory, override {@link #appendStacks}.
|
|
COMMENT
|
|
COMMENT <p>Items with no custom behavior, like diamonds, can call the constructor of Item
|
|
COMMENT directly. If a custom behavior is needed, this should be subclassed. Items also have
|
|
COMMENT to be registered in the {@link net.minecraft.util.registry.Registry#ITEM} registry.
|
|
COMMENT
|
|
COMMENT <p>Many methods of this class are called on both the logical client and logical server,
|
|
COMMENT so take caution when using those methods. The logical side can be checked using
|
|
COMMENT {@link World#isClient}. See also <a href="https://fabricmc.net/wiki/tutorial:side">
|
|
COMMENT the Fabric Wiki article</a>. It is also important that methods that take {@link LivingEntity}
|
|
COMMENT as an argument can be called by non-players (such as foxes eating food), which causes
|
|
COMMENT a crash if the code performs unchecked casting.
|
|
COMMENT
|
|
COMMENT @see BlockItem
|
|
COMMENT @see ItemStack
|
|
COMMENT @see net.minecraft.inventory.Inventory
|
|
FIELD field_18672 foodComponent Lnet/minecraft/class_4174;
|
|
FIELD field_21979 fireproof Z
|
|
FIELD field_27017 LOGGER Lorg/slf4j/Logger;
|
|
FIELD field_30887 DEFAULT_MAX_COUNT I
|
|
FIELD field_30888 DEFAULT_MAX_USE_TIME I
|
|
FIELD field_30889 ITEM_BAR_STEPS I
|
|
FIELD field_36401 registryEntry Lnet/minecraft/class_6880$class_6883;
|
|
FIELD field_40209 featureSet Lnet/minecraft/class_7699;
|
|
FIELD field_8001 ATTACK_SPEED_MODIFIER_ID Ljava/util/UUID;
|
|
FIELD field_8003 BLOCK_ITEMS Ljava/util/Map;
|
|
FIELD field_8006 ATTACK_DAMAGE_MODIFIER_ID Ljava/util/UUID;
|
|
FIELD field_8008 recipeRemainder Lnet/minecraft/class_1792;
|
|
FIELD field_8009 rarity Lnet/minecraft/class_1814;
|
|
FIELD field_8012 maxDamage I
|
|
FIELD field_8013 maxCount I
|
|
FIELD field_8014 translationKey Ljava/lang/String;
|
|
METHOD <init> (Lnet/minecraft/class_1792$class_1793;)V
|
|
ARG 1 settings
|
|
METHOD method_16698 isNetworkSynced ()Z
|
|
COMMENT {@return whether the item needs to sync additional data to clients}
|
|
COMMENT
|
|
COMMENT <p>Items should ideally store all necessary information on the stack's NBT.
|
|
COMMENT However, this is not always possible for things like maps. In those cases,
|
|
COMMENT items can send a packet to the player holding it that syncs additional data.
|
|
COMMENT Such items must subclass {@link NetworkSyncedItem}.
|
|
COMMENT
|
|
COMMENT @see NetworkSyncedItem
|
|
METHOD method_19263 isFood ()Z
|
|
COMMENT Checks if this item is food and therefore is edible.
|
|
METHOD method_19264 getFoodComponent ()Lnet/minecraft/class_4174;
|
|
COMMENT {@return this item's {@link #foodComponent FoodComponent}, or {@code null} if none was set}
|
|
METHOD method_21830 getEatSound ()Lnet/minecraft/class_3414;
|
|
COMMENT {@return the sound for eating the item}
|
|
METHOD method_21831 getDrinkSound ()Lnet/minecraft/class_3414;
|
|
COMMENT {@return the sound for drinking the item}
|
|
METHOD method_24357 damage (Lnet/minecraft/class_1282;)Z
|
|
COMMENT {@return whether this item can be damaged by the given {@link DamageSource source}}
|
|
ARG 1 source
|
|
METHOD method_24358 isFireproof ()Z
|
|
COMMENT {@return whether this item is immune to fire and lava damage}
|
|
METHOD method_31565 onStackClicked (Lnet/minecraft/class_1799;Lnet/minecraft/class_1735;Lnet/minecraft/class_5536;Lnet/minecraft/class_1657;)Z
|
|
COMMENT Called when the item at the cursor is clicked at {@code slot}.
|
|
COMMENT
|
|
COMMENT <p>While this method is usually called on the logical server, it can also be called on
|
|
COMMENT the logical client, so take caution when overriding this method. The logical side can be
|
|
COMMENT checked using {@link World#isClient}.
|
|
COMMENT
|
|
COMMENT <p>For example, this is called on {@link BundleItem} when the cursor holds
|
|
COMMENT a bundle and the player clicks on the slot.
|
|
COMMENT
|
|
COMMENT @return whether the action was successful
|
|
ARG 1 stack
|
|
COMMENT the stack the cursor holds
|
|
ARG 2 slot
|
|
COMMENT the clicked slot
|
|
ARG 3 clickType
|
|
ARG 4 player
|
|
METHOD method_31566 onClicked (Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;Lnet/minecraft/class_1735;Lnet/minecraft/class_5536;Lnet/minecraft/class_1657;Lnet/minecraft/class_5630;)Z
|
|
COMMENT Called when the item at {@code slot} gets clicked by the cursor
|
|
COMMENT holding {@code otherStack}.
|
|
COMMENT
|
|
COMMENT <p>While this method is usually called on the logical server, it can also be called on
|
|
COMMENT the logical client, so take caution when overriding this method. The logical side can be
|
|
COMMENT checked using {@link World#isClient}.
|
|
COMMENT
|
|
COMMENT <p>For example, this is called on {@link BundleItem} when the cursor holds
|
|
COMMENT an item and the player clicks on the slot that has a bundle.
|
|
COMMENT
|
|
COMMENT @return whether the action was successful
|
|
ARG 1 stack
|
|
COMMENT the slot's stack
|
|
ARG 2 otherStack
|
|
COMMENT the stack the cursor holds
|
|
ARG 3 slot
|
|
COMMENT the clicked slot
|
|
ARG 4 clickType
|
|
ARG 5 player
|
|
ARG 6 cursorStackReference
|
|
METHOD method_31567 isItemBarVisible (Lnet/minecraft/class_1799;)Z
|
|
COMMENT {@return whether to show the item bar for {@code stack}}
|
|
COMMENT
|
|
COMMENT <p>Item bar is usually used to display durability of the stack.
|
|
COMMENT
|
|
COMMENT <p>When overriding this, {@link #getItemBarStep} and {@link #getItemBarColor} should
|
|
COMMENT also be overridden.
|
|
ARG 1 stack
|
|
METHOD method_31568 canBeNested ()Z
|
|
COMMENT @return true if the item can be placed inside of shulker boxes or bundles.
|
|
METHOD method_31569 getItemBarStep (Lnet/minecraft/class_1799;)I
|
|
COMMENT {@return the step, or the length of the colored area of the item bar, for
|
|
COMMENT {@code stack}}
|
|
COMMENT
|
|
COMMENT <p>This is between {@code 0.0f} and {code 13.0f}. By default, this is
|
|
COMMENT {@code durability * 13.0f / maxDurability}.
|
|
COMMENT
|
|
COMMENT <p>When overriding this, {@link #isItemBarVisible} and {@link #getItemBarColor} should
|
|
COMMENT also be overridden.
|
|
ARG 1 stack
|
|
METHOD method_31570 getEquipSound ()Lnet/minecraft/class_3414;
|
|
COMMENT {@return the sound for equipping the item, or {@code null} if no sound is played}
|
|
METHOD method_31571 getItemBarColor (Lnet/minecraft/class_1799;)I
|
|
COMMENT {@return the RGB color of the item bar, usually used for durability display}
|
|
COMMENT
|
|
COMMENT <p>When overriding this, {@link #isItemBarVisible} and {@link #getItemBarStep} should
|
|
COMMENT also be overridden.
|
|
ARG 1 stack
|
|
METHOD method_32346 getTooltipData (Lnet/minecraft/class_1799;)Ljava/util/Optional;
|
|
ARG 1 stack
|
|
METHOD method_33261 onItemEntityDestroyed (Lnet/minecraft/class_1542;)V
|
|
COMMENT Called on the server when an {@link ItemEntity} holding this item gets destroyed.
|
|
COMMENT This can happen due to fire, lava, cactus, explosion, etc. Items that can hold
|
|
COMMENT other items should override this to drop its contents.
|
|
COMMENT
|
|
COMMENT @see ItemUsage#spawnItemContents
|
|
ARG 1 entity
|
|
METHOD method_40131 getRegistryEntry ()Lnet/minecraft/class_6880$class_6883;
|
|
METHOD method_7836 use (Lnet/minecraft/class_1937;Lnet/minecraft/class_1657;Lnet/minecraft/class_1268;)Lnet/minecraft/class_1271;
|
|
COMMENT Called when the player uses (or starts using) the item.
|
|
COMMENT The use action, by default, is bound to the right mouse button.
|
|
COMMENT This method checks the player's hunger when the item is a food, and will
|
|
COMMENT {@linkplain TypedActionResult#pass pass} in all other cases by default.
|
|
COMMENT
|
|
COMMENT <p>If the item {@linkplain #getMaxUseTime can be used for multiple ticks}, then
|
|
COMMENT this will only be called when the player starts using it. After that,
|
|
COMMENT {@link #usageTick} is called every tick until the player {@linkplain #finishUsing
|
|
COMMENT finishes using the item}.
|
|
COMMENT
|
|
COMMENT <p>This method is called on both the logical client and logical server, so take caution when overriding this method.
|
|
COMMENT The logical side can be checked using {@link net.minecraft.world.World#isClient() world.isClient()}.
|
|
COMMENT
|
|
COMMENT @return a typed action result that specifies whether using the item was successful.
|
|
COMMENT The action result contains the new item stack that the player's hand will be set to.
|
|
ARG 1 world
|
|
COMMENT the world the item was used in
|
|
ARG 2 user
|
|
COMMENT the player who used the item
|
|
ARG 3 hand
|
|
COMMENT the hand used
|
|
METHOD method_7837 getEnchantability ()I
|
|
COMMENT Gets the enchantability of an item.
|
|
COMMENT This specifies the ability of an item to receive enchantments when enchanted using an enchanting table.
|
|
COMMENT As the value increases, the amount and level of enchantments applied increase.
|
|
COMMENT
|
|
COMMENT <p>If the value of this method is 0, the item cannot be enchanted using an enchanting table.
|
|
METHOD method_7838 isUsedOnRelease (Lnet/minecraft/class_1799;)Z
|
|
ARG 1 stack
|
|
METHOD method_7840 onStoppedUsing (Lnet/minecraft/class_1799;Lnet/minecraft/class_1937;Lnet/minecraft/class_1309;I)V
|
|
COMMENT Called on both the client and the server when an entity stops using an item
|
|
COMMENT before reaching the {@linkplain #getMaxUseTime maximum use time}. If the time was
|
|
COMMENT reached, {@link #finishUsing} is called instead.
|
|
COMMENT
|
|
COMMENT <p>This method is called on both the logical client and logical server, so take caution
|
|
COMMENT when overriding this method. The logical side can be checked using {@link
|
|
COMMENT World#isClient}.
|
|
COMMENT
|
|
COMMENT <p>{@code user} might not be a player in some cases. For example, this occurs when
|
|
COMMENT an entity uses a crossbow.
|
|
ARG 1 stack
|
|
ARG 2 world
|
|
ARG 3 user
|
|
ARG 4 remainingUseTicks
|
|
METHOD method_7841 getMaxDamage ()I
|
|
COMMENT {@return the maximum durability of this item} Can be configured through {@link Item.Settings#maxDamage(int) settings.maxDamage()}.
|
|
METHOD method_7843 onCraft (Lnet/minecraft/class_1799;Lnet/minecraft/class_1937;Lnet/minecraft/class_1657;)V
|
|
COMMENT Called when a player acquires the item by crafting, smelting, smithing, etc.
|
|
ARG 1 stack
|
|
ARG 2 world
|
|
ARG 3 player
|
|
METHOD method_7844 getAttributeModifiers (Lnet/minecraft/class_1304;)Lcom/google/common/collect/Multimap;
|
|
COMMENT {@return the attribute modifiers the item provides}
|
|
COMMENT
|
|
COMMENT <p>Tools and armor should override this to specify the attack damage or armor points.
|
|
ARG 1 slot
|
|
METHOD method_7846 isDamageable ()Z
|
|
COMMENT {@return whether this item can lose durability}
|
|
METHOD method_7847 useOnEntity (Lnet/minecraft/class_1799;Lnet/minecraft/class_1657;Lnet/minecraft/class_1309;Lnet/minecraft/class_1268;)Lnet/minecraft/class_1269;
|
|
COMMENT Called on both the client and the server when a player uses the item on an entity.
|
|
COMMENT
|
|
COMMENT <p>This method is called on both the logical client and logical server, so take caution
|
|
COMMENT when overriding this method. The logical side can be checked using {@link
|
|
COMMENT World#isClient}.
|
|
COMMENT
|
|
COMMENT <p>This should be used if the item can be used on multiple types of entities,
|
|
COMMENT such as name tags or saddles.
|
|
COMMENT
|
|
COMMENT @return the action result
|
|
ARG 1 stack
|
|
ARG 2 user
|
|
ARG 3 entity
|
|
ARG 4 hand
|
|
METHOD method_7848 getName ()Lnet/minecraft/class_2561;
|
|
METHOD method_7851 appendTooltip (Lnet/minecraft/class_1799;Lnet/minecraft/class_1937;Ljava/util/List;Lnet/minecraft/class_1836;)V
|
|
COMMENT Called by the client to append tooltips to an item. Subclasses can override
|
|
COMMENT this and add custom tooltips to {@code tooltip} list.
|
|
ARG 1 stack
|
|
ARG 2 world
|
|
ARG 3 tooltip
|
|
COMMENT the list of tooltips to show
|
|
ARG 4 context
|
|
METHOD method_7852 usageTick (Lnet/minecraft/class_1937;Lnet/minecraft/class_1309;Lnet/minecraft/class_1799;I)V
|
|
COMMENT Called on both the server and the client every tick while an entity uses
|
|
COMMENT the item. Currently used by {@link CrossbowItem} to charge the crossbow.
|
|
COMMENT If this is overridden, {@link #getMaxUseTime} should also be overridden to
|
|
COMMENT return a positive value.
|
|
COMMENT
|
|
COMMENT @see #finishUsing
|
|
COMMENT @see #use
|
|
ARG 1 world
|
|
ARG 2 user
|
|
ARG 3 stack
|
|
ARG 4 remainingUseTicks
|
|
COMMENT how long it's left until the entity finishes using the item, in ticks
|
|
METHOD method_7853 getUseAction (Lnet/minecraft/class_1799;)Lnet/minecraft/class_1839;
|
|
COMMENT {@return the use action the item should perform}
|
|
ARG 1 stack
|
|
METHOD method_7854 getDefaultStack ()Lnet/minecraft/class_1799;
|
|
COMMENT {@return the default stack for this item}
|
|
COMMENT
|
|
COMMENT <p>Items that expect certain NBT data in the item stack should override
|
|
COMMENT this method to return the stack with the NBT data.
|
|
METHOD method_7856 isSuitableFor (Lnet/minecraft/class_2680;)Z
|
|
COMMENT Determines whether this item can be used as a suitable tool for mining the specified block.
|
|
COMMENT Depending on block implementation, when combined together, the correct item and block may achieve a better mining speed and yield
|
|
COMMENT drops that would not be obtained when mining otherwise.
|
|
COMMENT <p>
|
|
COMMENT Note that this is not the <b>only</b> way to achieve "effectiveness" when mining.
|
|
COMMENT Other items, such as shears on string, may use their own logic
|
|
COMMENT and calls to this method might not return a value consistent to this rule for those items.
|
|
ARG 1 state
|
|
METHOD method_7857 hasRecipeRemainder ()Z
|
|
COMMENT Checks if this item has a remainder item that is left behind when used as a crafting ingredient.
|
|
METHOD method_7858 getRecipeRemainder ()Lnet/minecraft/class_1792;
|
|
COMMENT Gets the remainder item that should be left behind when this item is used as a crafting ingredient.
|
|
METHOD method_7860 postProcessNbt (Lnet/minecraft/class_2487;)V
|
|
COMMENT Processes the NBT applied to an item stack of this item.
|
|
COMMENT
|
|
COMMENT <p>This is only used in vanilla to process player head NBT data.
|
|
ARG 1 nbt
|
|
METHOD method_7861 finishUsing (Lnet/minecraft/class_1799;Lnet/minecraft/class_1937;Lnet/minecraft/class_1309;)Lnet/minecraft/class_1799;
|
|
COMMENT Called when an entity finishes using the item, such as eating food or drinking a potion.
|
|
COMMENT This method handles eating food by default.
|
|
COMMENT
|
|
COMMENT <p>This method is called on both the logical client and logical server, so take caution
|
|
COMMENT when overriding this method. The logical side can be checked using {@link
|
|
COMMENT World#isClient}.
|
|
COMMENT
|
|
COMMENT <p>{@code user} might not be a player in some cases. For example, this occurs when a fox
|
|
COMMENT eats food or when a wandering trader drinks milk.
|
|
COMMENT
|
|
COMMENT @return the new item stack after using the item
|
|
ARG 1 stack
|
|
ARG 2 world
|
|
ARG 3 user
|
|
METHOD method_7862 getRarity (Lnet/minecraft/class_1799;)Lnet/minecraft/class_1814;
|
|
COMMENT {@return this item's rarity, which changes the color of its name}
|
|
COMMENT
|
|
COMMENT <p>By default, if an item has an enchantment, its rarity is modified:
|
|
COMMENT <ul>
|
|
COMMENT \t<li>Common and Uncommon -> Rare
|
|
COMMENT \t<li>Rare -> Epic
|
|
COMMENT </ul>
|
|
ARG 1 stack
|
|
METHOD method_7864 getName (Lnet/minecraft/class_1799;)Lnet/minecraft/class_2561;
|
|
ARG 1 stack
|
|
METHOD method_7865 getMiningSpeedMultiplier (Lnet/minecraft/class_1799;Lnet/minecraft/class_2680;)F
|
|
COMMENT {@return the multiplier applied to the mining speed of {@code stack} when mining
|
|
COMMENT {@code state}}
|
|
COMMENT
|
|
COMMENT <p>The default value is {@code 1.0f}. Returning larger integer will cause the block
|
|
COMMENT to be mined faster. Enchantments, status effects, and other effects that affect
|
|
COMMENT mining speed are instead handled in {@link PlayerEntity#getBlockBreakingSpeed}.
|
|
COMMENT
|
|
COMMENT @see MiningToolItem
|
|
ARG 1 stack
|
|
ARG 2 state
|
|
METHOD method_7866 getTranslationKey (Lnet/minecraft/class_1799;)Ljava/lang/String;
|
|
COMMENT Gets the translation key of this item using the provided item stack for context.
|
|
ARG 1 stack
|
|
METHOD method_7867 fromBlock (Lnet/minecraft/class_2248;)Lnet/minecraft/class_1792;
|
|
COMMENT @deprecated Please use {@link Block#asItem}
|
|
ARG 0 block
|
|
METHOD method_7869 getOrCreateTranslationKey ()Ljava/lang/String;
|
|
METHOD method_7870 isEnchantable (Lnet/minecraft/class_1799;)Z
|
|
COMMENT {@return whether the given {@link ItemStack} is enchantable}
|
|
COMMENT
|
|
COMMENT <p>By default, ItemStacks are enchantable if their max stack count is 1 and they can be damaged.
|
|
ARG 1 stack
|
|
METHOD method_7872 raycast (Lnet/minecraft/class_1937;Lnet/minecraft/class_1657;Lnet/minecraft/class_3959$class_242;)Lnet/minecraft/class_3965;
|
|
ARG 0 world
|
|
ARG 1 player
|
|
ARG 2 fluidHandling
|
|
METHOD method_7873 postHit (Lnet/minecraft/class_1799;Lnet/minecraft/class_1309;Lnet/minecraft/class_1309;)Z
|
|
COMMENT Called on the server when the item is used to hit an entity.
|
|
COMMENT
|
|
COMMENT <p>Tools and melee weapons should override this to damage the stack.
|
|
COMMENT
|
|
COMMENT @return whether the item's use stat should be incremented
|
|
COMMENT @see ItemStack#damage(int, LivingEntity, java.util.function.Consumer)
|
|
ARG 1 stack
|
|
ARG 2 target
|
|
ARG 3 attacker
|
|
METHOD method_7875 byRawId (I)Lnet/minecraft/class_1792;
|
|
COMMENT {@return the item from its raw ID}
|
|
ARG 0 id
|
|
METHOD method_7876 getTranslationKey ()Ljava/lang/String;
|
|
COMMENT Gets the translation key of this item.
|
|
METHOD method_7878 canRepair (Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)Z
|
|
COMMENT {@return whether {@code stack} can be repaired using {@code ingredient}}
|
|
COMMENT
|
|
COMMENT <p>This only handles repairing using the ingredient such as diamonds, and does
|
|
COMMENT not handle combining tools or armor.
|
|
ARG 1 stack
|
|
ARG 2 ingredient
|
|
METHOD method_7879 postMine (Lnet/minecraft/class_1799;Lnet/minecraft/class_1937;Lnet/minecraft/class_2680;Lnet/minecraft/class_2338;Lnet/minecraft/class_1309;)Z
|
|
COMMENT Called on the server when the item is used to break a block.
|
|
COMMENT
|
|
COMMENT <p>Tools and melee weapons should override this to damage the stack, after
|
|
COMMENT checking if the block's hardness is larger than {@code 0.0f}.
|
|
COMMENT
|
|
COMMENT @return whether the item's use stat should be incremented
|
|
COMMENT @see net.minecraft.block.AbstractBlock.AbstractBlockState#getHardness
|
|
COMMENT @see ItemStack#damage(int, LivingEntity, java.util.function.Consumer)
|
|
ARG 1 stack
|
|
ARG 2 world
|
|
ARG 3 state
|
|
ARG 4 pos
|
|
ARG 5 miner
|
|
METHOD method_7880 getRawId (Lnet/minecraft/class_1792;)I
|
|
COMMENT {@return the raw ID of {@code item}, or 0 if passed {@code null}}
|
|
ARG 0 item
|
|
METHOD method_7881 getMaxUseTime (Lnet/minecraft/class_1799;)I
|
|
COMMENT {@return the maximum use (right-click) time of this item, in ticks}
|
|
COMMENT Once a player has used an item for said number of ticks, they stop using it, and {@link Item#finishUsing} is called.
|
|
ARG 1 stack
|
|
METHOD method_7882 getMaxCount ()I
|
|
COMMENT {@return the maximum stack count of any ItemStack with this item} Can be configured through {@link Item.Settings#maxCount(int) settings.maxCount()}.
|
|
METHOD method_7884 useOnBlock (Lnet/minecraft/class_1838;)Lnet/minecraft/class_1269;
|
|
COMMENT Called when an item is used on a block.
|
|
COMMENT
|
|
COMMENT <p>This method is called on both the logical client and logical server, so take caution when using this method.
|
|
COMMENT The logical side can be checked using {@link net.minecraft.world.World#isClient() context.getWorld().isClient()}.
|
|
COMMENT
|
|
COMMENT @return an action result that specifies if using the item on a block was successful.
|
|
ARG 1 context
|
|
COMMENT the usage context
|
|
METHOD method_7885 canMine (Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;)Z
|
|
COMMENT {@return whether a player can break a block while holding the item}
|
|
COMMENT
|
|
COMMENT <p>This is to check whether the player can start breaking the block in the
|
|
COMMENT first place; this does not check if the item is a correct tool to mine the block.
|
|
COMMENT Melee weapons should override this to return {@code false}, unless it is also
|
|
COMMENT intended to be used as a tool.
|
|
ARG 1 state
|
|
ARG 2 world
|
|
ARG 3 pos
|
|
ARG 4 miner
|
|
METHOD method_7886 hasGlint (Lnet/minecraft/class_1799;)Z
|
|
COMMENT Checks if the glint effect should be applied when the item is rendered.
|
|
COMMENT
|
|
COMMENT <p>By default, returns true if the item has enchantments.
|
|
ARG 1 stack
|
|
METHOD method_7887 isNbtSynced ()Z
|
|
COMMENT Checks if an item should have its NBT data stored in {@link ItemStack#nbt} sent to the client.
|
|
COMMENT
|
|
COMMENT <p>If an item is damageable, this method is ignored and data is always synced to client.
|
|
METHOD method_7888 inventoryTick (Lnet/minecraft/class_1799;Lnet/minecraft/class_1937;Lnet/minecraft/class_1297;IZ)V
|
|
COMMENT Called on both the client and the server every tick if the item is in the player's inventory.
|
|
COMMENT
|
|
COMMENT <p>This method is called on both the logical client and logical server, so take caution
|
|
COMMENT when overriding this method. The logical side can be checked using {@link
|
|
COMMENT World#isClient}.
|
|
ARG 1 stack
|
|
ARG 2 world
|
|
ARG 3 entity
|
|
COMMENT the entity holding the item; usually a player
|
|
ARG 4 slot
|
|
ARG 5 selected
|
|
COMMENT whether the item is in the selected hotbar slot
|
|
CLASS class_1793 Settings
|
|
COMMENT Item settings configure behaviors common to all items, such as the stack's max
|
|
COMMENT count and the item group. An instance of this must be passed to the constructor
|
|
COMMENT of {@link Item} (or most of its subclasses).
|
|
FIELD field_18673 foodComponent Lnet/minecraft/class_4174;
|
|
FIELD field_21980 fireproof Z
|
|
FIELD field_40210 featureSet Lnet/minecraft/class_7699;
|
|
FIELD field_8016 rarity Lnet/minecraft/class_1814;
|
|
FIELD field_8018 recipeRemainder Lnet/minecraft/class_1792;
|
|
FIELD field_8019 maxDamage I
|
|
FIELD field_8020 maxCount I
|
|
METHOD method_19265 food (Lnet/minecraft/class_4174;)Lnet/minecraft/class_1792$class_1793;
|
|
COMMENT When set, any item configured with this Settings instance will be edible based on the provided {@link FoodComponent}.
|
|
COMMENT
|
|
COMMENT @return this instance
|
|
ARG 1 foodComponent
|
|
COMMENT configured food properties for any item using this Settings instance
|
|
METHOD method_24359 fireproof ()Lnet/minecraft/class_1792$class_1793;
|
|
COMMENT If called, any item with this Settings instance is immune to fire and lava damage.
|
|
COMMENT
|
|
COMMENT @return this instance
|
|
METHOD method_45434 requires ([Lnet/minecraft/class_7696;)Lnet/minecraft/class_1792$class_1793;
|
|
ARG 1 features
|
|
METHOD method_7889 maxCount (I)Lnet/minecraft/class_1792$class_1793;
|
|
COMMENT Sets the maximum stack count of any ItemStack with an Item using this Settings instance.
|
|
COMMENT
|
|
COMMENT <p>Note that a count over 64 leads to unreliable behavior in GUIs.
|
|
COMMENT Damageable items can not have a maximum stack count (they default to 1).
|
|
COMMENT An Item.Settings' max count defaults to 64.
|
|
COMMENT
|
|
COMMENT @throws RuntimeException if this Settings instance also has a max damage value set
|
|
COMMENT @return this instance
|
|
ARG 1 maxCount
|
|
COMMENT maximum stack count of any ItemStack with an item using this Settings instance
|
|
METHOD method_7894 rarity (Lnet/minecraft/class_1814;)Lnet/minecraft/class_1792$class_1793;
|
|
COMMENT Sets the {@link Rarity} of any item configured with this Settings instance, which changes the color of its name.
|
|
COMMENT
|
|
COMMENT <p>An item's rarity defaults to {@link Rarity#COMMON}.
|
|
COMMENT
|
|
COMMENT @return this instance
|
|
ARG 1 rarity
|
|
COMMENT rarity to apply to items using this Settings instance
|
|
METHOD method_7895 maxDamage (I)Lnet/minecraft/class_1792$class_1793;
|
|
COMMENT Sets the maximum durability of any item configured with this Settings instance.
|
|
COMMENT
|
|
COMMENT <p>Note that max stack count is set to 1 when this method is called.
|
|
COMMENT
|
|
COMMENT @return this instance
|
|
ARG 1 maxDamage
|
|
COMMENT maximum durability of an ItemStack using an item with this Item.Settings instance
|
|
METHOD method_7896 recipeRemainder (Lnet/minecraft/class_1792;)Lnet/minecraft/class_1792$class_1793;
|
|
COMMENT Sets the recipe remainder for any item configured with this Settings instance.
|
|
COMMENT When an item with a recipe remainder is used in a crafting recipe, the remainder is left in the table or returned to the player.
|
|
COMMENT
|
|
COMMENT @return this instance
|
|
ARG 1 recipeRemainder
|
|
METHOD method_7898 maxDamageIfAbsent (I)Lnet/minecraft/class_1792$class_1793;
|
|
COMMENT Calls {@link Item.Settings#maxDamage} If this Settings instance has not already set max damage (or if max damage is the default value, 0).
|
|
COMMENT
|
|
COMMENT <p>Note that max stack count is set to 1 when maxDamage is called.
|
|
COMMENT
|
|
COMMENT @return this instance
|
|
ARG 1 maxDamage
|
|
COMMENT maximum durability of an ItemStack using an item with this Item.Settings instance
|