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,CustomTransformTypeTest.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 BlockDeprecated.static final Stringstatic final StringFields 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_SIZEFields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendHoverText(ItemStack p_40572_, Level p_40573_, List<Component> p_40574_, TooltipFlag p_40575_) booleanprotected booleancanPlace(BlockPlaceContext p_40611_, BlockState p_40612_) getBlock()static CompoundTaggetBlockEntityData(ItemStack p_186337_) private Blockprotected BlockStategetPlacementState(BlockPlaceContext p_40613_) protected SoundEventgetPlaceSound(BlockState p_40588_) Deprecated.protected SoundEventgetPlaceSound(BlockState state, Level world, BlockPos pos, Player entity) protected booleanvoidonDestroyed(ItemEntity p_150700_) place(BlockPlaceContext p_40577_) protected booleanplaceBlock(BlockPlaceContext p_40578_, BlockState p_40579_) voidregisterBlocks(Map<Block, Item> p_40607_, Item p_40608_) voidremoveFromBlockToItemMap(Map<Block, Item> blockToItemMap, Item itemIn) static voidsetBlockEntityData(ItemStack p_186339_, BlockEntityType<?> p_186340_, CompoundTag p_186341_) private BlockStateupdateBlockStateFromTag(BlockPos p_40603_, Level p_40604_, ItemStack p_40605_, BlockState p_40606_) protected booleanupdateCustomBlockEntityTag(BlockPos p_40597_, Level p_40598_, Player p_40599_, ItemStack p_40600_, BlockState p_40601_) static booleanupdateCustomBlockEntityTag(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, getEquipSound, 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, verifyTagAfterLoadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabledMethods inherited from interface net.minecraftforge.common.extensions.IForgeItem
canApplyAtEnchantingTable, canContinueUsing, canDisableShield, canElytraFly, canEquip, 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, onItemUseFirst, onLeftClickEntity, onUsingTick, 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:
getDescriptionIdin classItem
-
appendHoverText
public void appendHoverText(ItemStack p_40572_, @Nullable Level p_40573_, List<Component> p_40574_, TooltipFlag p_40575_) - Overrides:
appendHoverTextin classItem
-
getBlock
-
getBlockRaw
-
registerBlocks
-
removeFromBlockToItemMap
-
canFitInsideContainerItems
public boolean canFitInsideContainerItems()- Overrides:
canFitInsideContainerItemsin classItem
-
onDestroyed
- Overrides:
onDestroyedin classItem
-
getBlockEntityData
-
setBlockEntityData
public static void setBlockEntityData(ItemStack p_186339_, BlockEntityType<?> p_186340_, CompoundTag p_186341_) -
requiredFeatures
- Specified by:
requiredFeaturesin interfaceFeatureElement- Overrides:
requiredFeaturesin classItem
-