Package net.minecraft.item
Class BlockItem
- java.lang.Object
-
- net.minecraftforge.registries.ForgeRegistryEntry<Item>
-
- net.minecraft.item.Item
-
- net.minecraft.item.BlockItem
-
- All Implemented Interfaces:
IItemProvider
,IForgeItem
,IForgeRegistryEntry<Item>
- Direct Known Subclasses:
BedItem
,BlockNamedItem
,LilyPadItem
,OperatorOnlyItem
,ScaffoldingItem
,TallBlockItem
,WallOrFloorItem
public class BlockItem extends Item
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.minecraft.item.Item
Item.Properties
-
Nested classes/interfaces inherited from class net.minecraftforge.registries.ForgeRegistryEntry
ForgeRegistryEntry.UncheckedRegistryEntry<V extends IForgeRegistryEntry<V>>
-
-
Field Summary
Fields Modifier and Type Field Description private Block
block
Deprecated.-
Fields inherited from class net.minecraft.item.Item
BASE_ATTACK_DAMAGE_UUID, BASE_ATTACK_SPEED_UUID, BY_BLOCK, canRepair, category, random
-
Fields inherited from class net.minecraftforge.registries.ForgeRegistryEntry
delegate
-
-
Constructor Summary
Constructors Constructor Description BlockItem(Block p_i48527_1_, Item.Properties p_i48527_2_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
appendHoverText(ItemStack p_77624_1_, World p_77624_2_, java.util.List<ITextComponent> p_77624_3_, ITooltipFlag p_77624_4_)
protected boolean
canPlace(BlockItemUseContext p_195944_1_, BlockState p_195944_2_)
void
fillItemCategory(ItemGroup p_150895_1_, NonNullList<ItemStack> p_150895_2_)
Block
getBlock()
private Block
getBlockRaw()
java.lang.String
getDescriptionId()
protected BlockState
getPlacementState(BlockItemUseContext p_195945_1_)
protected SoundEvent
getPlaceSound(BlockState p_219983_1_)
Deprecated.protected SoundEvent
getPlaceSound(BlockState state, World world, BlockPos pos, PlayerEntity entity)
protected boolean
mustSurvive()
ActionResultType
place(BlockItemUseContext p_195942_1_)
protected boolean
placeBlock(BlockItemUseContext p_195941_1_, BlockState p_195941_2_)
void
registerBlocks(java.util.Map<Block,Item> p_195946_1_, Item p_195946_2_)
void
removeFromBlockToItemMap(java.util.Map<Block,Item> blockToItemMap, Item itemIn)
private BlockState
updateBlockStateFromTag(BlockPos p_219985_1_, World p_219985_2_, ItemStack p_219985_3_, BlockState p_219985_4_)
protected boolean
updateCustomBlockEntityTag(BlockPos p_195943_1_, World p_195943_2_, PlayerEntity p_195943_3_, ItemStack p_195943_4_, BlockState p_195943_5_)
static boolean
updateCustomBlockEntityTag(World p_179224_0_, PlayerEntity p_179224_1_, BlockPos p_179224_2_, ItemStack p_179224_3_)
BlockItemUseContext
updatePlacementContext(BlockItemUseContext p_219984_1_)
private static <T extends java.lang.Comparable<T>>
BlockStateupdateState(BlockState p_219988_0_, Property<T> p_219988_1_, java.lang.String p_219988_2_)
ActionResultType
useOn(ItemUseContext p_195939_1_)
-
Methods inherited from class net.minecraft.item.Item
allowdedIn, asItem, byBlock, byId, canAttackBlock, canBeDepleted, canBeHurtBy, finishUsingItem, getCraftingRemainingItem, getDefaultAttributeModifiers, getDefaultInstance, getDescription, getDescriptionId, getDestroySpeed, getDrinkingSound, getEatingSound, getEnchantmentValue, getFoodProperties, getHarvestLevel, getId, getItemCategory, getItemStackTileEntityRenderer, getMaxDamage, getMaxStackSize, getName, getOrCreateDescriptionId, getPlayerPOVHitResult, getRarity, getTags, getToolTypes, getUseAnimation, getUseDuration, hasCraftingRemainingItem, hurtEnemy, interactLivingEntity, inventoryTick, is, isComplex, isCorrectToolForDrops, isEdible, isEnchantable, isFireResistant, isFoil, isRepairable, isValidRepairItem, mineBlock, onCraftedBy, onUseTick, releaseUsing, shouldOverrideMultiplayerNbt, toString, use, useOnRelease, verifyTagAfterLoad
-
Methods inherited from class net.minecraftforge.registries.ForgeRegistryEntry
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.minecraftforge.common.extensions.IForgeItem
canApplyAtEnchantingTable, canContinueUsing, canDisableShield, canElytraFly, canEquip, canHarvestBlock, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getArmorModel, getArmorTexture, getAttributeModifiers, getBurnTime, getBurnTime, getContainerItem, getCreativeTabs, getCreatorModId, getDamage, getDurabilityForDisplay, getEntityLifespan, getEquipmentSlot, getFontRenderer, getHighlightTip, getItem, getItemEnchantability, getItemStackLimit, getMaxDamage, getRGBDurabilityForDisplay, getShareTag, getSmeltingExperience, getXpRepairRatio, hasContainerItem, hasCustomEntity, initCapabilities, isBookEnchantable, isDamageable, isDamaged, isEnderMask, isPiglinCurrency, isShield, makesPiglinsNeutral, onArmorTick, onBlockStartBreak, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onItemUseFirst, onLeftClickEntity, onUsingTick, readShareTag, renderHelmetOverlay, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation, showDurabilityBar
-
-
-
-
Field Detail
-
block
@Deprecated private final Block block
Deprecated.
-
-
Constructor Detail
-
BlockItem
public BlockItem(Block p_i48527_1_, Item.Properties p_i48527_2_)
-
-
Method Detail
-
useOn
public ActionResultType useOn(ItemUseContext p_195939_1_)
-
place
public ActionResultType place(BlockItemUseContext p_195942_1_)
-
getPlaceSound
@Deprecated protected SoundEvent getPlaceSound(BlockState p_219983_1_)
Deprecated.
-
getPlaceSound
protected SoundEvent getPlaceSound(BlockState state, World world, BlockPos pos, PlayerEntity entity)
-
updatePlacementContext
@Nullable public BlockItemUseContext updatePlacementContext(BlockItemUseContext p_219984_1_)
-
updateCustomBlockEntityTag
protected boolean updateCustomBlockEntityTag(BlockPos p_195943_1_, World p_195943_2_, @Nullable PlayerEntity p_195943_3_, ItemStack p_195943_4_, BlockState p_195943_5_)
-
getPlacementState
@Nullable protected BlockState getPlacementState(BlockItemUseContext p_195945_1_)
-
updateBlockStateFromTag
private BlockState updateBlockStateFromTag(BlockPos p_219985_1_, World p_219985_2_, ItemStack p_219985_3_, BlockState p_219985_4_)
-
updateState
private static <T extends java.lang.Comparable<T>> BlockState updateState(BlockState p_219988_0_, Property<T> p_219988_1_, java.lang.String p_219988_2_)
-
canPlace
protected boolean canPlace(BlockItemUseContext p_195944_1_, BlockState p_195944_2_)
-
mustSurvive
protected boolean mustSurvive()
-
placeBlock
protected boolean placeBlock(BlockItemUseContext p_195941_1_, BlockState p_195941_2_)
-
updateCustomBlockEntityTag
public static boolean updateCustomBlockEntityTag(World p_179224_0_, @Nullable PlayerEntity p_179224_1_, BlockPos p_179224_2_, ItemStack p_179224_3_)
-
getDescriptionId
public java.lang.String getDescriptionId()
- Overrides:
getDescriptionId
in classItem
-
fillItemCategory
public void fillItemCategory(ItemGroup p_150895_1_, NonNullList<ItemStack> p_150895_2_)
- Overrides:
fillItemCategory
in classItem
-
appendHoverText
public void appendHoverText(ItemStack p_77624_1_, @Nullable World p_77624_2_, java.util.List<ITextComponent> p_77624_3_, ITooltipFlag p_77624_4_)
- Overrides:
appendHoverText
in classItem
-
getBlock
public Block getBlock()
-
getBlockRaw
private Block getBlockRaw()
-
registerBlocks
public void registerBlocks(java.util.Map<Block,Item> p_195946_1_, Item p_195946_2_)
-
-