Class BundleItem

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

public class BundleItem
extends Item
  • Field Details

    • ITEM_BAR_COLOR

      private static final int ITEM_BAR_COLOR
  • Constructor Details

  • Method Details

    • getAmountFilled

      @Environment(CLIENT) public static float getAmountFilled​(ItemStack stack)
    • onStackClicked

      public boolean onStackClicked​(ItemStack stack, ItemStack otherStack, ClickType clickType, PlayerInventory playerInventory)
      Overrides:
      onStackClicked in class Item
    • onClicked

      public boolean onClicked​(ItemStack stack, ItemStack otherStack, ClickType clickType, PlayerInventory playerInventory)
      Overrides:
      onClicked in class Item
    • use

      public TypedActionResult<ItemStack> use​(World world, PlayerEntity user, Hand hand)
      Called when an item is used by a player. The use action, by default, is bound to the right mouse button.

      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.
    • isItemBarVisible

      @Environment(CLIENT) public boolean isItemBarVisible​(ItemStack stack)
      Overrides:
      isItemBarVisible in class Item
    • getItemBarStep

      @Environment(CLIENT) public int getItemBarStep​(ItemStack stack)
      Overrides:
      getItemBarStep in class Item
    • getItemBarColor

      @Environment(CLIENT) public int getItemBarColor​(ItemStack stack)
      Overrides:
      getItemBarColor in class Item
    • addToBundle

      private static void addToBundle​(ItemStack bundle, ItemStack stack)
    • method_32344

      private static Optional<CompoundTag> method_32344​(ItemStack itemStack, ListTag listTag)
    • getItemOccupancy

      private static int getItemOccupancy​(ItemStack stack)
    • getBundleOccupancy

      private static int getBundleOccupancy​(ItemStack stack)
    • emptyBundle

      private static void emptyBundle​(ItemStack stack, PlayerInventory playerInventory)
    • method_32345

      private static Stream<ItemStack> method_32345​(ItemStack itemStack)
    • method_32346

      @Environment(CLIENT) public Optional<class_5632> method_32346​(ItemStack itemStack)
      Overrides:
      method_32346 in class Item