Package net.minecraft.world.item
Class BundleItem
java.lang.Object
net.minecraft.world.item.Item
net.minecraft.world.item.BundleItem
- All Implemented Interfaces:
FeatureElement
,ItemLike
,IItemExtension
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.item.Item
Item.Properties, Item.TooltipContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final int
static final int
static final int
static final int
static final int
private static final int
private static final int
private static final int
Fields inherited from class net.minecraft.world.item.Item
ABSOLUTE_MAX_STACK_SIZE, APPROXIMATELY_INFINITE_USE_DURATION, BASE_ATTACK_DAMAGE_ID, BASE_ATTACK_SPEED_ID, BY_BLOCK, canCombineRepair, CODEC, DEFAULT_MAX_STACK_SIZE, descriptionId, MAX_BAR_WIDTH, STREAM_CODEC
Fields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
broadcastChangesOnContainerMenu
(Player pPlayer) private boolean
dropContent
(ItemStack pStack, Player pPlayer) private void
dropContent
(Level pLevel, Player pPlayer, ItemStack pStack) static List
<BundleItem> int
getBarColor
(ItemStack pStack) int
getBarWidth
(ItemStack pStack) static Item
getByColor
(DyeColor pColor) static float
getFullnessDisplay
(ItemStack pStack) static int
getNumberOfItemsToShow
(ItemStack pBundle) static int
getSelectedItem
(ItemStack pBundle) static ItemStack
getSelectedItemStack
(ItemStack pBundle) getTooltipImage
(ItemStack pStack) getUseAnimation
(ItemStack pStack) int
getUseDuration
(ItemStack pStack, LivingEntity pEntity) static boolean
hasSelectedItem
(ItemStack pBundle) boolean
isBarVisible
(ItemStack pStack) void
onDestroyed
(ItemEntity pItemEntity) void
onUseTick
(Level pLevel, LivingEntity pLivingEntity, ItemStack pStack, int pRemainingUseDuration) Called as the item is being used by an entity.boolean
overrideOtherStackedOnMe
(ItemStack pStack, ItemStack pOther, Slot pSlot, ClickAction pAction, Player pPlayer, SlotAccess pAccess) boolean
overrideStackedOnOther
(ItemStack pStack, Slot pSlot, ClickAction pAction, Player pPlayer) private static void
playDropContentsSound
(Level pLevel, Entity pEntity) private static void
playInsertFailSound
(Entity pEntity) private static void
playInsertSound
(Entity pEntity) private static void
playRemoveOneSound
(Entity pEntity) removeOneItemFromBundle
(ItemStack pStack, Player pPlayer, BundleContents pBundleContents) static void
toggleSelectedItem
(ItemStack pBundle, int pSelectedItem) use
(Level pLevel, Player pPlayer, InteractionHand pHand) Methods inherited from class net.minecraft.world.item.Item
appendHoverText, asItem, builtInRegistryHolder, byBlock, byId, canDestroyBlock, canFitInsideContainerItems, components, finishUsingItem, getAttackDamageBonus, getCraftingRemainder, getDamageSource, getDefaultInstance, getDefaultMaxStackSize, getDescriptionId, getDestroySpeed, getId, getName, getName, getPlayerPOVHitResult, hurtEnemy, interactLivingEntity, inventoryTick, isCombineRepairable, isCorrectToolForDrops, isFoil, mineBlock, modifyDefaultComponentsFrom, onCraftedBy, onCraftedPostProcess, postHurtEnemy, releaseUsing, requiredFeatures, shouldPrintOpWarning, toString, useOn, useOnRelease, verifyComponentsAfterLoad
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabled
Methods inherited from interface net.neoforged.neoforge.common.extensions.IItemExtension
applyEnchantments, canBeHurtBy, canContinueUsing, canEquip, canGrindstoneRepair, canPerformAction, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, getAllEnchantments, getBurnTime, getCraftingRemainder, getCreatorModId, getDamage, getDefaultAttributeModifiers, getEnchantmentLevel, getEntityLifespan, getEquipmentSlot, getHighlightTip, getMaxDamage, getMaxStackSize, getSweepHitBox, getXpRepairRatio, hasCustomEntity, isDamageable, isDamaged, isGazeDisguise, isNotReplaceableByPickAction, isPiglinCurrency, isPrimaryItemFor, makesPiglinsNeutral, onAnimalArmorTick, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onItemUseFirst, onLeftClickEntity, onStopUsing, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation, supportsEnchantment
-
Field Details
-
MAX_SHOWN_GRID_ITEMS_X
public static final int MAX_SHOWN_GRID_ITEMS_X- See Also:
-
MAX_SHOWN_GRID_ITEMS_Y
public static final int MAX_SHOWN_GRID_ITEMS_Y- See Also:
-
MAX_SHOWN_GRID_ITEMS
public static final int MAX_SHOWN_GRID_ITEMS- See Also:
-
OVERFLOWING_MAX_SHOWN_GRID_ITEMS
public static final int OVERFLOWING_MAX_SHOWN_GRID_ITEMS- See Also:
-
FULL_BAR_COLOR
private static final int FULL_BAR_COLOR -
BAR_COLOR
private static final int BAR_COLOR -
TICKS_AFTER_FIRST_THROW
private static final int TICKS_AFTER_FIRST_THROW- See Also:
-
TICKS_BETWEEN_THROWS
private static final int TICKS_BETWEEN_THROWS- See Also:
-
TICKS_MAX_THROW_DURATION
private static final int TICKS_MAX_THROW_DURATION- See Also:
-
-
Constructor Details
-
BundleItem
-
-
Method Details
-
getFullnessDisplay
-
overrideStackedOnOther
public boolean overrideStackedOnOther(ItemStack pStack, Slot pSlot, ClickAction pAction, Player pPlayer) - Overrides:
overrideStackedOnOther
in classItem
-
overrideOtherStackedOnMe
public boolean overrideOtherStackedOnMe(ItemStack pStack, ItemStack pOther, Slot pSlot, ClickAction pAction, Player pPlayer, SlotAccess pAccess) - Overrides:
overrideOtherStackedOnMe
in classItem
-
use
-
dropContent
-
isBarVisible
- Overrides:
isBarVisible
in classItem
-
getBarWidth
- Overrides:
getBarWidth
in classItem
-
getBarColor
- Overrides:
getBarColor
in classItem
-
toggleSelectedItem
-
hasSelectedItem
-
getSelectedItem
-
getSelectedItemStack
-
getNumberOfItemsToShow
-
dropContent
-
removeOneItemFromBundle
private static Optional<ItemStack> removeOneItemFromBundle(ItemStack pStack, Player pPlayer, BundleContents pBundleContents) -
onUseTick
public void onUseTick(Level pLevel, LivingEntity pLivingEntity, ItemStack pStack, int pRemainingUseDuration) Called as the item is being used by an entity. -
getUseDuration
- Overrides:
getUseDuration
in classItem
-
getUseAnimation
- Overrides:
getUseAnimation
in classItem
-
getTooltipImage
- Overrides:
getTooltipImage
in classItem
-
onDestroyed
- Overrides:
onDestroyed
in classItem
-
getAllBundleItemColors
-
getByColor
-
playRemoveOneSound
-
playInsertSound
-
playInsertFailSound
-
playDropContentsSound
-
broadcastChangesOnContainerMenu
-