Package net.minecraft.world.item
Class BlockItem
java.lang.Object
net.minecraft.world.item.Item
net.minecraft.world.item.BlockItem
- All Implemented Interfaces:
FeatureElement
,ItemLike
,IItemExtension
- Direct Known Subclasses:
BedItem
,CustomItemDisplayContextTest.ItemHangerItem
,DoubleHighBlockItem
,GameMasterBlockItem
,ItemNameBlockItem
,PlaceOnWaterBlockItem
,ScaffoldingBlockItem
,SolidBucketItem
,StandingAndWallBlockItem
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.item.Item
Item.Properties, Item.TooltipContext
-
Field Summary
Fields inherited from class net.minecraft.world.item.Item
ABSOLUTE_MAX_STACK_SIZE, BASE_ATTACK_DAMAGE_UUID, BASE_ATTACK_SPEED_UUID, BY_BLOCK, canRepair, DEFAULT_MAX_STACK_SIZE, MAX_BAR_WIDTH
Fields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
appendHoverText
(ItemStack p_40572_, Item.TooltipContext p_339655_, List<Component> p_40574_, TooltipFlag p_40575_) boolean
protected boolean
canPlace
(BlockPlaceContext p_40611_, BlockState p_40612_) getBlock()
protected BlockState
getPlacementState
(BlockPlaceContext p_40613_) protected SoundEvent
getPlaceSound
(BlockState p_40588_) Deprecated.protected SoundEvent
getPlaceSound
(BlockState state, Level world, BlockPos pos, Player entity) protected boolean
void
onDestroyed
(ItemEntity p_150700_) place
(BlockPlaceContext p_40577_) protected boolean
placeBlock
(BlockPlaceContext p_40578_, BlockState p_40579_) void
registerBlocks
(Map<Block, Item> p_40607_, Item p_40608_) void
removeFromBlockToItemMap
(Map<Block, Item> blockToItemMap, Item itemIn) static void
setBlockEntityData
(ItemStack p_186339_, BlockEntityType<?> p_186340_, CompoundTag p_186341_) private static void
updateBlockEntityComponents
(Level p_331559_, BlockPos p_331993_, ItemStack p_332021_) private BlockState
updateBlockStateFromTag
(BlockPos p_40603_, Level p_40604_, ItemStack p_40605_, BlockState p_40606_) protected boolean
updateCustomBlockEntityTag
(BlockPos p_40597_, Level p_40598_, Player p_40599_, ItemStack p_40600_, BlockState p_40601_) static boolean
updateCustomBlockEntityTag
(Level p_40583_, Player p_40584_, BlockPos p_40585_, ItemStack p_40586_) updatePlacementContext
(BlockPlaceContext p_40609_) useOn
(UseOnContext p_40581_) Methods inherited from class net.minecraft.world.item.Item
asItem, builtInRegistryHolder, byBlock, byId, canAttackBlock, components, finishUsingItem, getAttackDamageBonus, getBarColor, getBarWidth, getBreakingSound, getCraftingRemainingItem, getDefaultAttributeModifiers, getDefaultInstance, getDefaultMaxStackSize, getDescription, getDescriptionId, getDestroySpeed, getDrinkingSound, getEatingSound, getEnchantmentValue, getId, getName, getOrCreateDescriptionId, getPlayerPOVHitResult, getRenderPropertiesInternal, getTooltipImage, getUseAnimation, getUseDuration, hasCraftingRemainingItem, hurtEnemy, initializeClient, interactLivingEntity, inventoryTick, isBarVisible, isComplex, isCorrectToolForDrops, isEnchantable, isFoil, isRepairable, isValidRepairItem, mineBlock, modifyDefaultComponentsFrom, onCraftedBy, onCraftedPostProcess, onUseTick, overrideOtherStackedOnMe, overrideStackedOnOther, releaseUsing, toString, use, 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
canApplyAtEnchantingTable, canContinueUsing, canDisableShield, canElytraFly, canEquip, canGrindstoneRepair, canPerformAction, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getAllEnchantments, getArmorTexture, getAttributeModifiers, getBurnTime, getCraftingRemainingItem, getCreatorModId, getDamage, getEnchantmentLevel, getEnchantmentValue, getEntityLifespan, getEquipmentSlot, getFoodProperties, getHighlightTip, getMaxDamage, getMaxStackSize, getSweepHitBox, getXpRepairRatio, hasCraftingRemainingItem, hasCustomEntity, isBookEnchantable, isDamageable, isDamaged, isEnderMask, isNotReplaceableByPickAction, isPiglinCurrency, makesPiglinsNeutral, onAnimalArmorTick, onArmorTick, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onItemUseFirst, onLeftClickEntity, onStopUsing, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation
-
Field Details
-
block
Deprecated.
-
-
Constructor Details
-
BlockItem
-
-
Method Details
-
useOn
-
place
-
getPlaceSound
Deprecated. -
getPlaceSound
-
updatePlacementContext
-
updateBlockEntityComponents
-
updateCustomBlockEntityTag
protected boolean updateCustomBlockEntityTag(BlockPos p_40597_, Level p_40598_, @Nullable Player p_40599_, ItemStack p_40600_, BlockState p_40601_) -
getPlacementState
-
updateBlockStateFromTag
private BlockState updateBlockStateFromTag(BlockPos p_40603_, Level p_40604_, ItemStack p_40605_, BlockState p_40606_) -
canPlace
-
mustSurvive
protected boolean mustSurvive() -
placeBlock
-
updateCustomBlockEntityTag
-
getDescriptionId
- Overrides:
getDescriptionId
in classItem
-
appendHoverText
public void appendHoverText(ItemStack p_40572_, Item.TooltipContext p_339655_, List<Component> p_40574_, TooltipFlag p_40575_) - Overrides:
appendHoverText
in classItem
-
getBlock
-
registerBlocks
-
removeFromBlockToItemMap
-
canFitInsideContainerItems
public boolean canFitInsideContainerItems()- Overrides:
canFitInsideContainerItems
in classItem
-
onDestroyed
- Overrides:
onDestroyed
in classItem
-
setBlockEntityData
public static void setBlockEntityData(ItemStack p_186339_, BlockEntityType<?> p_186340_, CompoundTag p_186341_) -
requiredFeatures
- Specified by:
requiredFeatures
in interfaceFeatureElement
- Overrides:
requiredFeatures
in classItem
-