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
,IForgeItem
- 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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Block
Deprecated.static final String
static final String
Fields inherited from class net.minecraft.world.item.Item
BASE_ATTACK_DAMAGE_UUID, BASE_ATTACK_SPEED_UUID, BY_BLOCK, canRepair, EAT_DURATION, MAX_BAR_WIDTH, MAX_STACK_SIZE
Fields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendHoverText
(ItemStack p_40572_, Level p_40573_, List<Component> p_40574_, TooltipFlag p_40575_) boolean
protected boolean
canPlace
(BlockPlaceContext p_40611_, BlockState p_40612_) getBlock()
static CompoundTag
getBlockEntityData
(ItemStack p_186337_) private Block
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 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_) private static <T extends Comparable<T>>
BlockStateupdateState
(BlockState p_40594_, Property<T> p_40595_, String p_40596_) useOn
(UseOnContext p_40581_) Methods inherited from class net.minecraft.world.item.Item
asItem, builtInRegistryHolder, byBlock, byId, canAttackBlock, canBeDepleted, canBeHurtBy, finishUsingItem, getBarColor, getBarWidth, getCraftingRemainingItem, getDefaultAttributeModifiers, getDefaultInstance, getDescription, getDescriptionId, getDestroySpeed, getDrinkingSound, getEatingSound, getEnchantmentValue, getFoodProperties, getId, getMaxDamage, getMaxStackSize, getName, getOrCreateDescriptionId, getPlayerPOVHitResult, getRarity, getRenderPropertiesInternal, getTooltipImage, getUseAnimation, getUseDuration, hasCraftingRemainingItem, hurtEnemy, initializeClient, interactLivingEntity, inventoryTick, isBarVisible, isComplex, isCorrectToolForDrops, isEdible, isEnchantable, isFireResistant, isFoil, isRepairable, isValidRepairItem, mineBlock, onCraftedBy, onUseTick, overrideOtherStackedOnMe, overrideStackedOnOther, releaseUsing, shouldOverrideMultiplayerNbt, toString, use, useOnRelease, verifyTagAfterLoad
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.minecraftforge.common.extensions.IForgeItem
canApplyAtEnchantingTable, canContinueUsing, canDisableShield, canElytraFly, canEquip, canGrindstoneRepair, canPerformAction, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getAllEnchantments, getArmorTexture, getAttributeModifiers, getBurnTime, getCraftingRemainingItem, getCreatorModId, getDamage, getDefaultTooltipHideFlags, getEnchantmentLevel, getEnchantmentValue, getEntityLifespan, getEquipmentSlot, getFoodProperties, getHighlightTip, getMaxDamage, getMaxStackSize, getShareTag, getSweepHitBox, getXpRepairRatio, hasCraftingRemainingItem, hasCustomEntity, initCapabilities, isBookEnchantable, isCorrectToolForDrops, isDamageable, isDamaged, isEnderMask, isNotReplaceableByPickAction, isPiglinCurrency, makesPiglinsNeutral, onArmorTick, onBlockStartBreak, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onInventoryTick, onItemUseFirst, onLeftClickEntity, onStopUsing, readShareTag, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation
-
Field Details
-
BLOCK_ENTITY_TAG
- See Also:
-
BLOCK_STATE_TAG
- See Also:
-
block
Deprecated.
-
-
Constructor Details
-
BlockItem
-
-
Method Details
-
useOn
-
place
-
getPlaceSound
Deprecated. -
getPlaceSound
-
updatePlacementContext
-
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_) -
updateState
private static <T extends Comparable<T>> BlockState updateState(BlockState p_40594_, Property<T> p_40595_, String p_40596_) -
canPlace
-
mustSurvive
protected boolean mustSurvive() -
placeBlock
-
updateCustomBlockEntityTag
-
getDescriptionId
- Overrides:
getDescriptionId
in classItem
-
appendHoverText
public void appendHoverText(ItemStack p_40572_, @Nullable Level p_40573_, List<Component> p_40574_, TooltipFlag p_40575_) - Overrides:
appendHoverText
in classItem
-
getBlock
-
getBlockRaw
-
registerBlocks
-
removeFromBlockToItemMap
-
canFitInsideContainerItems
public boolean canFitInsideContainerItems()- Overrides:
canFitInsideContainerItems
in classItem
-
onDestroyed
- Overrides:
onDestroyed
in classItem
-
getBlockEntityData
-
setBlockEntityData
public static void setBlockEntityData(ItemStack p_186339_, BlockEntityType<?> p_186340_, CompoundTag p_186341_) -
requiredFeatures
- Specified by:
requiredFeatures
in interfaceFeatureElement
- Overrides:
requiredFeatures
in classItem
-