Package net.minecraft.item
Class BlockItem
java.lang.Object
net.minecraft.item.Item
net.minecraft.item.BlockItem
- All Implemented Interfaces:
ItemConvertible
- Direct Known Subclasses:
AliasedBlockItem,BedItem,CommandBlockItem,LilyPadItem,ScaffoldingItem,TallBlockItem,WallStandingBlockItem
public class BlockItem extends Item
-
Nested Class Summary
-
Field Summary
Fields inherited from class net.minecraft.item.Item
ATTACK_DAMAGE_MODIFIER_ID, ATTACK_SPEED_MODIFIER_ID, BLOCK_ITEMS, group, RANDOM -
Constructor Summary
Constructors Constructor Description BlockItem(Block block, Item.Settings settings) -
Method Summary
Methods inherited from class net.minecraft.item.Item
asItem, byRawId, canMine, canRepair, damage, finishUsing, fromBlock, getAttributeModifiers, getDrinkSound, getEatSound, getEnchantability, getFoodComponent, getGroup, getMaxCount, getMaxDamage, getMaxUseTime, getMiningSpeedMultiplier, getName, getName, getOrCreateTranslationKey, getRarity, getRawId, getRecipeRemainder, getStackForRender, getTranslationKey, getUseAction, hasEnchantmentGlint, hasRecipeRemainder, inventoryTick, isDamageable, isEffectiveOn, isEnchantable, isFireproof, isFood, isIn, isIn, isNetworkSynced, isUsedOnRelease, onCraft, onStoppedUsing, postHit, postMine, postProcessTag, rayTrace, shouldSyncTagToClient, toString, usageTick, use, useOnEntity
-
Field Details
-
block
Deprecated.
-
-
Constructor Details
-
Method Details
-
useOnBlock
- Overrides:
useOnBlockin classItem
-
place
-
getPlaceSound
-
getPlacementContext
-
postPlacement
protected boolean postPlacement(BlockPos pos, World world, @Nullable PlayerEntity player, ItemStack stack, BlockState state) -
getPlacementState
-
placeFromTag
-
with
private static <T extends Comparable<T>> BlockState with(BlockState state, Property<T> property, String name) -
canPlace
-
checkStatePlacement
protected boolean checkStatePlacement() -
place
-
writeTagToBlockEntity
public static boolean writeTagToBlockEntity(World world, @Nullable PlayerEntity player, BlockPos pos, ItemStack stack) -
getTranslationKey
- Overrides:
getTranslationKeyin classItem
-
appendStacks
- Overrides:
appendStacksin classItem
-
appendTooltip
@Environment(CLIENT) public void appendTooltip(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context)- Overrides:
appendTooltipin classItem
-
getBlock
-
appendBlocks
-