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
,PowderSnowBucketItem
,ScaffoldingItem
,TallBlockItem
,WallStandingBlockItem
public class BlockItem extends Item
- Mappings:
Namespace Name official bma
intermediary net/minecraft/class_1747
named net/minecraft/item/BlockItem
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.item.Item
Item.Settings
-
Field Summary
Fields inherited from class net.minecraft.item.Item
ATTACK_DAMAGE_MODIFIER_ID, ATTACK_SPEED_MODIFIER_ID, BLOCK_ITEMS, group
-
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, getDefaultStack, getDrinkSound, getEatSound, getEnchantability, getEquipSound, getFoodComponent, getGroup, getItemBarColor, getItemBarStep, getMaxCount, getMaxDamage, getMaxUseTime, getMiningSpeedMultiplier, getName, getName, getOrCreateTranslationKey, getRarity, getRawId, getRecipeRemainder, getTooltipData, getTranslationKey, getUseAction, hasGlint, hasRecipeRemainder, inventoryTick, isDamageable, isEnchantable, isFireproof, isFood, isIn, isItemBarVisible, isNetworkSynced, isSuitableFor, isUsedOnRelease, onClicked, onCraft, onStackClicked, onStoppedUsing, postHit, postMine, postProcessTag, raycast, shouldSyncTagToClient, toString, usageTick, use, useOnEntity
-
Field Details
-
block
Deprecated.- Mappings:
Namespace Name Mixin selector official a
Lbma;a:Lbwu;
intermediary field_7901
Lnet/minecraft/class_1747;field_7901:Lnet/minecraft/class_2248;
named block
Lnet/minecraft/item/BlockItem;block:Lnet/minecraft/block/Block;
-
-
Constructor Details
-
BlockItem
- Mappings:
Namespace Name Mixin selector official <init>
Lbma;<init>(Lbwu;Lbnr$a;)V
intermediary <init>
Lnet/minecraft/class_1747;<init>(Lnet/minecraft/class_2248;Lnet/minecraft/class_1792$class_1793;)V
named <init>
Lnet/minecraft/item/BlockItem;<init>(Lnet/minecraft/block/Block;Lnet/minecraft/item/Item$Settings;)V
-
-
Method Details
-
useOnBlock
Called when an item is used on a block.This method is called on both the logical client and logical server, so take caution when using this method. The logical side can be checked using
context.getWorld().isClient()
.- Overrides:
useOnBlock
in classItem
- Parameters:
context
- the usage context- Returns:
- an action result that specifies if using the item on a block was successful.
- Mappings:
Namespace Name Mixin selector official a
Lbnr;a(Lbpx;)Lapq;
intermediary method_7884
Lnet/minecraft/class_1792;method_7884(Lnet/minecraft/class_1838;)Lnet/minecraft/class_1269;
named useOnBlock
Lnet/minecraft/item/Item;useOnBlock(Lnet/minecraft/item/ItemUsageContext;)Lnet/minecraft/util/ActionResult;
-
place
- Mappings:
Namespace Name Mixin selector official a
Lbma;a(Lbpv;)Lapq;
intermediary method_7712
Lnet/minecraft/class_1747;method_7712(Lnet/minecraft/class_1750;)Lnet/minecraft/class_1269;
named place
Lnet/minecraft/item/BlockItem;place(Lnet/minecraft/item/ItemPlacementContext;)Lnet/minecraft/util/ActionResult;
-
getPlaceSound
- Mappings:
Namespace Name Mixin selector official a
Lbma;a(Lcht;)Laef;
intermediary method_19260
Lnet/minecraft/class_1747;method_19260(Lnet/minecraft/class_2680;)Lnet/minecraft/class_3414;
named getPlaceSound
Lnet/minecraft/item/BlockItem;getPlaceSound(Lnet/minecraft/block/BlockState;)Lnet/minecraft/sound/SoundEvent;
-
getPlacementContext
- Mappings:
Namespace Name Mixin selector official b
Lbma;b(Lbpv;)Lbpv;
intermediary method_16356
Lnet/minecraft/class_1747;method_16356(Lnet/minecraft/class_1750;)Lnet/minecraft/class_1750;
named getPlacementContext
Lnet/minecraft/item/BlockItem;getPlacementContext(Lnet/minecraft/item/ItemPlacementContext;)Lnet/minecraft/item/ItemPlacementContext;
-
postPlacement
protected boolean postPlacement(BlockPos pos, World world, @Nullable PlayerEntity player, ItemStack stack, BlockState state)- Mappings:
Namespace Name Mixin selector official a
Lbma;a(Lfx;Lbtv;Lbhl;Lbnv;Lcht;)Z
intermediary method_7710
Lnet/minecraft/class_1747;method_7710(Lnet/minecraft/class_2338;Lnet/minecraft/class_1937;Lnet/minecraft/class_1657;Lnet/minecraft/class_1799;Lnet/minecraft/class_2680;)Z
named postPlacement
Lnet/minecraft/item/BlockItem;postPlacement(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/item/ItemStack;Lnet/minecraft/block/BlockState;)Z
-
getPlacementState
- Mappings:
Namespace Name Mixin selector official c
Lbma;c(Lbpv;)Lcht;
intermediary method_7707
Lnet/minecraft/class_1747;method_7707(Lnet/minecraft/class_1750;)Lnet/minecraft/class_2680;
named getPlacementState
Lnet/minecraft/item/BlockItem;getPlacementState(Lnet/minecraft/item/ItemPlacementContext;)Lnet/minecraft/block/BlockState;
-
placeFromTag
- Mappings:
Namespace Name Mixin selector official a
Lbma;a(Lfx;Lbtv;Lbnv;Lcht;)Lcht;
intermediary method_18084
Lnet/minecraft/class_1747;method_18084(Lnet/minecraft/class_2338;Lnet/minecraft/class_1937;Lnet/minecraft/class_1799;Lnet/minecraft/class_2680;)Lnet/minecraft/class_2680;
named placeFromTag
Lnet/minecraft/item/BlockItem;placeFromTag(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/World;Lnet/minecraft/item/ItemStack;Lnet/minecraft/block/BlockState;)Lnet/minecraft/block/BlockState;
-
with
private static <T extends Comparable<T>> BlockState with(BlockState state, Property<T> property, String name)- Mappings:
Namespace Name Mixin selector official a
Lbma;a(Lcht;Lciw;Ljava/lang/String;)Lcht;
intermediary method_18083
Lnet/minecraft/class_1747;method_18083(Lnet/minecraft/class_2680;Lnet/minecraft/class_2769;Ljava/lang/String;)Lnet/minecraft/class_2680;
named with
Lnet/minecraft/item/BlockItem;with(Lnet/minecraft/block/BlockState;Lnet/minecraft/state/property/Property;Ljava/lang/String;)Lnet/minecraft/block/BlockState;
-
canPlace
- Mappings:
Namespace Name Mixin selector official b
Lbma;b(Lbpv;Lcht;)Z
intermediary method_7709
Lnet/minecraft/class_1747;method_7709(Lnet/minecraft/class_1750;Lnet/minecraft/class_2680;)Z
named canPlace
Lnet/minecraft/item/BlockItem;canPlace(Lnet/minecraft/item/ItemPlacementContext;Lnet/minecraft/block/BlockState;)Z
-
checkStatePlacement
protected boolean checkStatePlacement()- Mappings:
Namespace Name Mixin selector official d
Lbma;d()Z
intermediary method_20360
Lnet/minecraft/class_1747;method_20360()Z
named checkStatePlacement
Lnet/minecraft/item/BlockItem;checkStatePlacement()Z
-
place
- Mappings:
Namespace Name Mixin selector official a
Lbma;a(Lbpv;Lcht;)Z
intermediary method_7708
Lnet/minecraft/class_1747;method_7708(Lnet/minecraft/class_1750;Lnet/minecraft/class_2680;)Z
named place
Lnet/minecraft/item/BlockItem;place(Lnet/minecraft/item/ItemPlacementContext;Lnet/minecraft/block/BlockState;)Z
-
writeTagToBlockEntity
public static boolean writeTagToBlockEntity(World world, @Nullable PlayerEntity player, BlockPos pos, ItemStack stack)- Mappings:
Namespace Name Mixin selector official a
Lbma;a(Lbtv;Lbhl;Lfx;Lbnv;)Z
intermediary method_7714
Lnet/minecraft/class_1747;method_7714(Lnet/minecraft/class_1937;Lnet/minecraft/class_1657;Lnet/minecraft/class_2338;Lnet/minecraft/class_1799;)Z
named writeTagToBlockEntity
Lnet/minecraft/item/BlockItem;writeTagToBlockEntity(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/item/ItemStack;)Z
-
getTranslationKey
Gets the translation key of this item.- Overrides:
getTranslationKey
in classItem
- Mappings:
Namespace Name Mixin selector official a
Lbnr;a()Ljava/lang/String;
intermediary method_7876
Lnet/minecraft/class_1792;method_7876()Ljava/lang/String;
named getTranslationKey
Lnet/minecraft/item/Item;getTranslationKey()Ljava/lang/String;
-
appendStacks
- Overrides:
appendStacks
in classItem
- Mappings:
Namespace Name Mixin selector official a
Lbnr;a(Lbmm;Lgj;)V
intermediary method_7850
Lnet/minecraft/class_1792;method_7850(Lnet/minecraft/class_1761;Lnet/minecraft/class_2371;)V
named appendStacks
Lnet/minecraft/item/Item;appendStacks(Lnet/minecraft/item/ItemGroup;Lnet/minecraft/util/collection/DefaultedList;)V
-
appendTooltip
@Environment(CLIENT) public void appendTooltip(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context)- Overrides:
appendTooltip
in classItem
- Mappings:
Namespace Name Mixin selector official a
Lbnr;a(Lbnv;Lbtv;Ljava/util/List;Lbpi;)V
intermediary method_7851
Lnet/minecraft/class_1792;method_7851(Lnet/minecraft/class_1799;Lnet/minecraft/class_1937;Ljava/util/List;Lnet/minecraft/class_1836;)V
named appendTooltip
Lnet/minecraft/item/Item;appendTooltip(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Ljava/util/List;Lnet/minecraft/client/item/TooltipContext;)V
-
getBlock
- Mappings:
Namespace Name Mixin selector official e
Lbma;e()Lbwu;
intermediary method_7711
Lnet/minecraft/class_1747;method_7711()Lnet/minecraft/class_2248;
named getBlock
Lnet/minecraft/item/BlockItem;getBlock()Lnet/minecraft/block/Block;
-
appendBlocks
- Mappings:
Namespace Name Mixin selector official a
Lbma;a(Ljava/util/Map;Lbnr;)V
intermediary method_7713
Lnet/minecraft/class_1747;method_7713(Ljava/util/Map;Lnet/minecraft/class_1792;)V
named appendBlocks
Lnet/minecraft/item/BlockItem;appendBlocks(Ljava/util/Map;Lnet/minecraft/item/Item;)V
-
hasStoredInventory
public boolean hasStoredInventory()- Overrides:
hasStoredInventory
in classItem
- Mappings:
Namespace Name Mixin selector official f
Lbnr;f()Z
intermediary method_31568
Lnet/minecraft/class_1792;method_31568()Z
named hasStoredInventory
Lnet/minecraft/item/Item;hasStoredInventory()Z
-
onItemEntityDestroyed
- Overrides:
onItemEntityDestroyed
in classItem
- Mappings:
Namespace Name Mixin selector official a
Lbnr;a(Lbek;)V
intermediary method_33261
Lnet/minecraft/class_1792;method_33261(Lnet/minecraft/class_1542;)V
named onItemEntityDestroyed
Lnet/minecraft/item/Item;onItemEntityDestroyed(Lnet/minecraft/entity/ItemEntity;)V
-