Class BundleItem

java.lang.Object
net.minecraft.item.Item
net.minecraft.item.BundleItem
All Implemented Interfaces:
ItemConvertible, ToggleableFeature

public class BundleItem extends Item
Mappings:
Namespace Name
named net/minecraft/item/BundleItem
intermediary net/minecraft/class_5537
official cwb
  • Field Details

    • TOOLTIP_STACKS_COLUMNS

      public static final int TOOLTIP_STACKS_COLUMNS
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named TOOLTIP_STACKS_COLUMNS Lnet/minecraft/item/BundleItem;TOOLTIP_STACKS_COLUMNS:I
      intermediary field_52575 Lnet/minecraft/class_5537;field_52575:I
      official a Lcwb;a:I
    • TOOLTIP_STACKS_ROWS

      public static final int TOOLTIP_STACKS_ROWS
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named TOOLTIP_STACKS_ROWS Lnet/minecraft/item/BundleItem;TOOLTIP_STACKS_ROWS:I
      intermediary field_52576 Lnet/minecraft/class_5537;field_52576:I
      official b Lcwb;b:I
    • MAX_TOOLTIP_STACKS_SHOWN

      public static final int MAX_TOOLTIP_STACKS_SHOWN
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named MAX_TOOLTIP_STACKS_SHOWN Lnet/minecraft/item/BundleItem;MAX_TOOLTIP_STACKS_SHOWN:I
      intermediary field_52577 Lnet/minecraft/class_5537;field_52577:I
      official c Lcwb;c:I
    • MAX_TOOLTIP_STACKS_SHOWN_WHEN_TOO_MANY_TYPES

      public static final int MAX_TOOLTIP_STACKS_SHOWN_WHEN_TOO_MANY_TYPES
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named MAX_TOOLTIP_STACKS_SHOWN_WHEN_TOO_MANY_TYPES Lnet/minecraft/item/BundleItem;MAX_TOOLTIP_STACKS_SHOWN_WHEN_TOO_MANY_TYPES:I
      intermediary field_52578 Lnet/minecraft/class_5537;field_52578:I
      official d Lcwb;d:I
    • FULL_ITEM_BAR_COLOR

      private static final int FULL_ITEM_BAR_COLOR
      Mappings:
      Namespace Name Mixin selector
      named FULL_ITEM_BAR_COLOR Lnet/minecraft/item/BundleItem;FULL_ITEM_BAR_COLOR:I
      intermediary field_52579 Lnet/minecraft/class_5537;field_52579:I
      official m Lcwb;m:I
    • ITEM_BAR_COLOR

      private static final int ITEM_BAR_COLOR
      Mappings:
      Namespace Name Mixin selector
      named ITEM_BAR_COLOR Lnet/minecraft/item/BundleItem;ITEM_BAR_COLOR:I
      intermediary field_27016 Lnet/minecraft/class_5537;field_27016:I
      official n Lcwb;n:I
    • field_54109

      private static final int field_54109
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_54109 Lnet/minecraft/item/BundleItem;field_54109:I
      intermediary field_54109 Lnet/minecraft/class_5537;field_54109:I
      official o Lcwb;o:I
    • field_54110

      private static final int field_54110
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_54110 Lnet/minecraft/item/BundleItem;field_54110:I
      intermediary field_54110 Lnet/minecraft/class_5537;field_54110:I
      official p Lcwb;p:I
    • MAX_USE_TIME

      private static final int MAX_USE_TIME
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named MAX_USE_TIME Lnet/minecraft/item/BundleItem;MAX_USE_TIME:I
      intermediary field_54111 Lnet/minecraft/class_5537;field_54111:I
      official q Lcwb;q:I
    • openFrontTexture

      private final Identifier openFrontTexture
      Mappings:
      Namespace Name Mixin selector
      named openFrontTexture Lnet/minecraft/item/BundleItem;openFrontTexture:Lnet/minecraft/util/Identifier;
      intermediary field_54112 Lnet/minecraft/class_5537;field_54112:Lnet/minecraft/class_2960;
      official r Lcwb;r:Lalz;
    • openBackTexture

      private final Identifier openBackTexture
      Mappings:
      Namespace Name Mixin selector
      named openBackTexture Lnet/minecraft/item/BundleItem;openBackTexture:Lnet/minecraft/util/Identifier;
      intermediary field_54113 Lnet/minecraft/class_5537;field_54113:Lnet/minecraft/class_2960;
      official s Lcwb;s:Lalz;
  • Constructor Details

    • BundleItem

      public BundleItem(Identifier openFrontTexture, Identifier openBackTexture, Item.Settings settings)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/item/BundleItem;<init>(Lnet/minecraft/util/Identifier;Lnet/minecraft/util/Identifier;Lnet/minecraft/item/Item$Settings;)V
      intermediary <init> Lnet/minecraft/class_5537;<init>(Lnet/minecraft/class_2960;Lnet/minecraft/class_2960;Lnet/minecraft/class_1792$class_1793;)V
      official <init> Lcwb;<init>(Lalz;Lalz;Lcxk$a;)V
  • Method Details

    • getAmountFilled

      public static float getAmountFilled(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named getAmountFilled Lnet/minecraft/item/BundleItem;getAmountFilled(Lnet/minecraft/item/ItemStack;)F
      intermediary method_31561 Lnet/minecraft/class_5537;method_31561(Lnet/minecraft/class_1799;)F
      official c Lcwb;c(Lcxo;)F
    • getOpenFrontTexture

      public Identifier getOpenFrontTexture()
      Mappings:
      Namespace Name Mixin selector
      named getOpenFrontTexture Lnet/minecraft/item/BundleItem;getOpenFrontTexture()Lnet/minecraft/util/Identifier;
      intermediary method_63677 Lnet/minecraft/class_5537;method_63677()Lnet/minecraft/class_2960;
      official b Lcwb;b()Lalz;
    • getOpenBackTexture

      public Identifier getOpenBackTexture()
      Mappings:
      Namespace Name Mixin selector
      named getOpenBackTexture Lnet/minecraft/item/BundleItem;getOpenBackTexture()Lnet/minecraft/util/Identifier;
      intermediary method_63678 Lnet/minecraft/class_5537;method_63678()Lnet/minecraft/class_2960;
      official c Lcwb;c()Lalz;
    • onStackClicked

      public boolean onStackClicked(ItemStack stack, Slot slot, ClickType clickType, PlayerEntity player)
      Called when the item at the cursor is clicked at slot.

      While this method is usually called on the logical server, it can also be called on the logical client, so take caution when overriding this method. The logical side can be checked using World.isClient.

      For example, this is called on BundleItem when the cursor holds a bundle and the player clicks on the slot.

      Overrides:
      onStackClicked in class Item
      Parameters:
      stack - the stack the cursor holds
      slot - the clicked slot
      Returns:
      whether the action was successful
      Mappings:
      Namespace Name Mixin selector
      named onStackClicked Lnet/minecraft/item/Item;onStackClicked(Lnet/minecraft/item/ItemStack;Lnet/minecraft/screen/slot/Slot;Lnet/minecraft/util/ClickType;Lnet/minecraft/entity/player/PlayerEntity;)Z
      intermediary method_31565 Lnet/minecraft/class_1792;method_31565(Lnet/minecraft/class_1799;Lnet/minecraft/class_1735;Lnet/minecraft/class_5536;Lnet/minecraft/class_1657;)Z
      official a Lcxk;a(Lcxo;Lcuy;Lctl;Lcpw;)Z
    • onClicked

      public boolean onClicked(ItemStack stack, ItemStack otherStack, Slot slot, ClickType clickType, PlayerEntity player, StackReference cursorStackReference)
      Called when the item at slot gets clicked by the cursor holding otherStack.

      While this method is usually called on the logical server, it can also be called on the logical client, so take caution when overriding this method. The logical side can be checked using World.isClient.

      For example, this is called on BundleItem when the cursor holds an item and the player clicks on the slot that has a bundle.

      Overrides:
      onClicked in class Item
      Parameters:
      stack - the slot's stack
      otherStack - the stack the cursor holds
      slot - the clicked slot
      Returns:
      whether the action was successful
      Mappings:
      Namespace Name Mixin selector
      named onClicked Lnet/minecraft/item/Item;onClicked(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;Lnet/minecraft/screen/slot/Slot;Lnet/minecraft/util/ClickType;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/inventory/StackReference;)Z
      intermediary method_31566 Lnet/minecraft/class_1792;method_31566(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
      official a Lcxk;a(Lcxo;Lcxo;Lcuy;Lctl;Lcpw;Lbwx;)Z
    • use

      public ActionResult use(World world, PlayerEntity user, Hand hand)
      Called when the player uses (or starts using) the item. The use action, by default, is bound to the right mouse button. This method checks the player's hunger when the item is a food, and will pass in all other cases by default.

      If the item can be used for multiple ticks, then this will only be called when the player starts using it. After that, usageTick(net.minecraft.world.World, net.minecraft.entity.LivingEntity, net.minecraft.item.ItemStack, int) is called every tick until the player finishes using the item.

      This method is called on both the logical client and logical server, so take caution when overriding this method. The logical side can be checked using world.isClient().

      Overrides:
      use in class Item
      Parameters:
      world - the world the item was used in
      user - the player who used the item
      hand - the hand used
      Returns:
      a typed action result that specifies whether using the item was successful. The action result contains the new item stack that the player's hand will be set to.
      Mappings:
      Namespace Name Mixin selector
      named use Lnet/minecraft/item/Item;use(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;)Lnet/minecraft/util/ActionResult;
      intermediary method_7836 Lnet/minecraft/class_1792;method_7836(Lnet/minecraft/class_1937;Lnet/minecraft/class_1657;Lnet/minecraft/class_1268;)Lnet/minecraft/class_1269;
      official a Lcxk;a(Ldhh;Lcpw;Lbth;)Lbti;
    • dropContentsOnUse

      private void dropContentsOnUse(World world, PlayerEntity player, ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named dropContentsOnUse Lnet/minecraft/item/BundleItem;dropContentsOnUse(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/item/ItemStack;)V
      intermediary method_63675 Lnet/minecraft/class_5537;method_63675(Lnet/minecraft/class_1937;Lnet/minecraft/class_1657;Lnet/minecraft/class_1799;)V
      official a Lcwb;a(Ldhh;Lcpw;Lcxo;)V
    • isItemBarVisible

      public boolean isItemBarVisible(ItemStack stack)
      Returns whether to show the item bar for stack.

      Item bar is usually used to display durability of the stack.

      When overriding this, getItemBarStep(net.minecraft.item.ItemStack) and getItemBarColor(net.minecraft.item.ItemStack) should also be overridden.

      Overrides:
      isItemBarVisible in class Item
      Returns:
      whether to show the item bar for stack
      Mappings:
      Namespace Name Mixin selector
      named isItemBarVisible Lnet/minecraft/item/Item;isItemBarVisible(Lnet/minecraft/item/ItemStack;)Z
      intermediary method_31567 Lnet/minecraft/class_1792;method_31567(Lnet/minecraft/class_1799;)Z
      official d Lcxk;d(Lcxo;)Z
    • getItemBarStep

      public int getItemBarStep(ItemStack stack)
      Returns the step, or the length of the colored area of the item bar, for stack.

      This is between 0.0f and {code 13.0f}. By default, this is durability * 13.0f / maxDurability.

      When overriding this, isItemBarVisible(net.minecraft.item.ItemStack) and getItemBarColor(net.minecraft.item.ItemStack) should also be overridden.

      Overrides:
      getItemBarStep in class Item
      Returns:
      the step, or the length of the colored area of the item bar, for stack
      Mappings:
      Namespace Name Mixin selector
      named getItemBarStep Lnet/minecraft/item/Item;getItemBarStep(Lnet/minecraft/item/ItemStack;)I
      intermediary method_31569 Lnet/minecraft/class_1792;method_31569(Lnet/minecraft/class_1799;)I
      official e Lcxk;e(Lcxo;)I
    • getItemBarColor

      public int getItemBarColor(ItemStack stack)
      Returns the RGB color of the item bar, usually used for durability display.

      When overriding this, isItemBarVisible(net.minecraft.item.ItemStack) and getItemBarStep(net.minecraft.item.ItemStack) should also be overridden.

      Overrides:
      getItemBarColor in class Item
      Returns:
      the RGB color of the item bar, usually used for durability display
      Mappings:
      Namespace Name Mixin selector
      named getItemBarColor Lnet/minecraft/item/Item;getItemBarColor(Lnet/minecraft/item/ItemStack;)I
      intermediary method_31571 Lnet/minecraft/class_1792;method_31571(Lnet/minecraft/class_1799;)I
      official f Lcxk;f(Lcxo;)I
    • setSelectedStackIndex

      public static void setSelectedStackIndex(ItemStack stack, int selectedStackIndex)
      Mappings:
      Namespace Name Mixin selector
      named setSelectedStackIndex Lnet/minecraft/item/BundleItem;setSelectedStackIndex(Lnet/minecraft/item/ItemStack;I)V
      intermediary method_61637 Lnet/minecraft/class_5537;method_61637(Lnet/minecraft/class_1799;I)V
      official a Lcwb;a(Lcxo;I)V
    • hasSelectedStack

      public static boolean hasSelectedStack(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named hasSelectedStack Lnet/minecraft/item/BundleItem;hasSelectedStack(Lnet/minecraft/item/ItemStack;)Z
      intermediary method_61642 Lnet/minecraft/class_5537;method_61642(Lnet/minecraft/class_1799;)Z
      official g Lcwb;g(Lcxo;)Z
    • getSelectedStackIndex

      public static int getSelectedStackIndex(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named getSelectedStackIndex Lnet/minecraft/item/BundleItem;getSelectedStackIndex(Lnet/minecraft/item/ItemStack;)I
      intermediary method_61643 Lnet/minecraft/class_5537;method_61643(Lnet/minecraft/class_1799;)I
      official h Lcwb;h(Lcxo;)I
    • getSelectedStack

      public static ItemStack getSelectedStack(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named getSelectedStack Lnet/minecraft/item/BundleItem;getSelectedStack(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/item/ItemStack;
      intermediary method_61644 Lnet/minecraft/class_5537;method_61644(Lnet/minecraft/class_1799;)Lnet/minecraft/class_1799;
      official i Lcwb;i(Lcxo;)Lcxo;
    • getNumberOfStacksShown

      public static int getNumberOfStacksShown(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named getNumberOfStacksShown Lnet/minecraft/item/BundleItem;getNumberOfStacksShown(Lnet/minecraft/item/ItemStack;)I
      intermediary method_61645 Lnet/minecraft/class_5537;method_61645(Lnet/minecraft/class_1799;)I
      official j Lcwb;j(Lcxo;)I
    • dropFirstBundledStack

      private boolean dropFirstBundledStack(ItemStack stack, PlayerEntity player)
      Mappings:
      Namespace Name Mixin selector
      named dropFirstBundledStack Lnet/minecraft/item/BundleItem;dropFirstBundledStack(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/player/PlayerEntity;)Z
      intermediary method_32757 Lnet/minecraft/class_5537;method_32757(Lnet/minecraft/class_1799;Lnet/minecraft/class_1657;)Z
      official a Lcwb;a(Lcxo;Lcpw;)Z
    • popFirstBundledStack

      private static Optional<ItemStack> popFirstBundledStack(ItemStack stack, PlayerEntity player, BundleContentsComponent contents)
      Mappings:
      Namespace Name Mixin selector
      named popFirstBundledStack Lnet/minecraft/item/BundleItem;popFirstBundledStack(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/component/type/BundleContentsComponent;)Ljava/util/Optional;
      intermediary method_63676 Lnet/minecraft/class_5537;method_63676(Lnet/minecraft/class_1799;Lnet/minecraft/class_1657;Lnet/minecraft/class_9276;)Ljava/util/Optional;
      official a Lcwb;a(Lcxo;Lcpw;Lczs;)Ljava/util/Optional;
    • usageTick

      public void usageTick(World world, LivingEntity user, ItemStack stack, int remainingUseTicks)
      Called on both the server and the client every tick while an entity uses the item. Currently used by CrossbowItem to charge the crossbow. If this is overridden, getMaxUseTime(net.minecraft.item.ItemStack, net.minecraft.entity.LivingEntity) should also be overridden to return a positive value.
      Overrides:
      usageTick in class Item
      Parameters:
      remainingUseTicks - how long it's left until the entity finishes using the item, in ticks
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named usageTick Lnet/minecraft/item/Item;usageTick(Lnet/minecraft/world/World;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemStack;I)V
      intermediary method_7852 Lnet/minecraft/class_1792;method_7852(Lnet/minecraft/class_1937;Lnet/minecraft/class_1309;Lnet/minecraft/class_1799;I)V
      official a Lcxk;a(Ldhh;Lbwf;Lcxo;I)V
    • getMaxUseTime

      public int getMaxUseTime(ItemStack stack, LivingEntity user)
      Returns the maximum use (right-click) time of this item, in ticks. Once a player has used an item for said number of ticks, they stop using it, and Item.finishUsing(net.minecraft.item.ItemStack, net.minecraft.world.World, net.minecraft.entity.LivingEntity) is called.
      Overrides:
      getMaxUseTime in class Item
      Returns:
      the maximum use (right-click) time of this item, in ticks
      Mappings:
      Namespace Name Mixin selector
      named getMaxUseTime Lnet/minecraft/item/Item;getMaxUseTime(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/LivingEntity;)I
      intermediary method_7881 Lnet/minecraft/class_1792;method_7881(Lnet/minecraft/class_1799;Lnet/minecraft/class_1309;)I
      official a Lcxk;a(Lcxo;Lbwf;)I
    • getTooltipData

      public Optional<TooltipData> getTooltipData(ItemStack stack)
      Overrides:
      getTooltipData in class Item
      Mappings:
      Namespace Name Mixin selector
      named getTooltipData Lnet/minecraft/item/Item;getTooltipData(Lnet/minecraft/item/ItemStack;)Ljava/util/Optional;
      intermediary method_32346 Lnet/minecraft/class_1792;method_32346(Lnet/minecraft/class_1799;)Ljava/util/Optional;
      official k Lcxk;k(Lcxo;)Ljava/util/Optional;
    • onItemEntityDestroyed

      public void onItemEntityDestroyed(ItemEntity entity)
      Called on the server when an ItemEntity holding this item gets destroyed. This can happen due to fire, lava, cactus, explosion, etc. Items that can hold other items should override this to drop its contents.
      Overrides:
      onItemEntityDestroyed in class Item
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named onItemEntityDestroyed Lnet/minecraft/item/Item;onItemEntityDestroyed(Lnet/minecraft/entity/ItemEntity;)V
      intermediary method_33261 Lnet/minecraft/class_1792;method_33261(Lnet/minecraft/class_1542;)V
      official a Lcxk;a(Lcma;)V
    • getBundles

      public static List<BundleItem> getBundles()
      Mappings:
      Namespace Name Mixin selector
      named getBundles Lnet/minecraft/item/BundleItem;getBundles()Ljava/util/List;
      intermediary method_64975 Lnet/minecraft/class_5537;method_64975()Ljava/util/List;
      official d Lcwb;d()Ljava/util/List;
    • getBundle

      public static Item getBundle(DyeColor color)
      Mappings:
      Namespace Name Mixin selector
      named getBundle Lnet/minecraft/item/BundleItem;getBundle(Lnet/minecraft/util/DyeColor;)Lnet/minecraft/item/Item;
      intermediary method_64277 Lnet/minecraft/class_5537;method_64277(Lnet/minecraft/class_1767;)Lnet/minecraft/class_1792;
      official a Lcwb;a(Lcwl;)Lcxk;
    • playRemoveOneSound

      private static void playRemoveOneSound(Entity entity)
      Mappings:
      Namespace Name Mixin selector
      named playRemoveOneSound Lnet/minecraft/item/BundleItem;playRemoveOneSound(Lnet/minecraft/entity/Entity;)V
      intermediary method_38074 Lnet/minecraft/class_5537;method_38074(Lnet/minecraft/class_1297;)V
      official a Lcwb;a(Lbvj;)V
    • playInsertSound

      private static void playInsertSound(Entity entity)
      Mappings:
      Namespace Name Mixin selector
      named playInsertSound Lnet/minecraft/item/BundleItem;playInsertSound(Lnet/minecraft/entity/Entity;)V
      intermediary method_38076 Lnet/minecraft/class_5537;method_38076(Lnet/minecraft/class_1297;)V
      official b Lcwb;b(Lbvj;)V
    • playInsertFailSound

      private static void playInsertFailSound(Entity entity)
      Mappings:
      Namespace Name Mixin selector
      named playInsertFailSound Lnet/minecraft/item/BundleItem;playInsertFailSound(Lnet/minecraft/entity/Entity;)V
      intermediary method_61641 Lnet/minecraft/class_5537;method_61641(Lnet/minecraft/class_1297;)V
      official c Lcwb;c(Lbvj;)V
    • playDropContentsSound

      private static void playDropContentsSound(World world, Entity entity)
      Mappings:
      Namespace Name Mixin selector
      named playDropContentsSound Lnet/minecraft/item/BundleItem;playDropContentsSound(Lnet/minecraft/world/World;Lnet/minecraft/entity/Entity;)V
      intermediary method_38077 Lnet/minecraft/class_5537;method_38077(Lnet/minecraft/class_1937;Lnet/minecraft/class_1297;)V
      official a Lcwb;a(Ldhh;Lbvj;)V
    • onContentChanged

      private void onContentChanged(PlayerEntity user)
      Mappings:
      Namespace Name Mixin selector
      named onContentChanged Lnet/minecraft/item/BundleItem;onContentChanged(Lnet/minecraft/entity/player/PlayerEntity;)V
      intermediary method_64502 Lnet/minecraft/class_5537;method_64502(Lnet/minecraft/class_1657;)V
      official a Lcwb;a(Lcpw;)V