Class BedItem

All Implemented Interfaces:
ItemConvertible, ToggleableFeature

public class BedItem extends BlockItem
Mappings:
Namespace Name
official chf
intermediary net/minecraft/class_1748
named net/minecraft/item/BedItem
  • Field Details

    • field_44151

      private final Multimap<EntityAttribute,EntityAttributeModifier> field_44151
      Mappings:
      Namespace Name Mixin selector
      official c Lchf;c:Lcom/google/common/collect/Multimap;
      intermediary field_44151 Lnet/minecraft/class_1748;field_44151:Lcom/google/common/collect/Multimap;
      named field_44151 Lnet/minecraft/item/BedItem;field_44151:Lcom/google/common/collect/Multimap;
  • Constructor Details

    • BedItem

      public BedItem(Block block, Item.Settings settings)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lchg;<init>(Lctm;Lcjm$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

    • place

      protected boolean place(ItemPlacementContext context, BlockState state)
      Overrides:
      place in class BlockItem
      Mappings:
      Namespace Name Mixin selector
      official a Lchg;a(Lcmc;Ldgh;)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
    • postHit

      public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker)
      Called on the server when the item is used to hit an entity.

      Tools and melee weapons should override this to damage the stack.

      Overrides:
      postHit in class Item
      Returns:
      whether the item's use stat should be incremented
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lcjm;a(Lcjr;Lbjh;Lbjh;)Z
      intermediary method_7873 Lnet/minecraft/class_1792;method_7873(Lnet/minecraft/class_1799;Lnet/minecraft/class_1309;Lnet/minecraft/class_1309;)Z
      named postHit Lnet/minecraft/item/Item;postHit(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/LivingEntity;)Z
    • appendTooltip

      public void appendTooltip(ItemStack stack, @Nullable @Nullable World world, List<Text> tooltip, TooltipContext context)
      Called by the client to append tooltips to an item. Subclasses can override this and add custom tooltips to tooltip list.
      Overrides:
      appendTooltip in class BlockItem
      Parameters:
      tooltip - the list of tooltips to show
      Mappings:
      Namespace Name Mixin selector
      official a Lcjm;a(Lcjr;Lcql;Ljava/util/List;Lcll;)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
    • getAttributeModifiers

      public Multimap<EntityAttribute,EntityAttributeModifier> getAttributeModifiers(EquipmentSlot slot)
      Returns the attribute modifiers the item provides.

      Tools and armor should override this to specify the attack damage or armor points.

      Overrides:
      getAttributeModifiers in class Item
      Returns:
      the attribute modifiers the item provides
      Mappings:
      Namespace Name Mixin selector
      official a Lcjm;a(Lbiw;)Lcom/google/common/collect/Multimap;
      intermediary method_7844 Lnet/minecraft/class_1792;method_7844(Lnet/minecraft/class_1304;)Lcom/google/common/collect/Multimap;
      named getAttributeModifiers Lnet/minecraft/item/Item;getAttributeModifiers(Lnet/minecraft/entity/EquipmentSlot;)Lcom/google/common/collect/Multimap;