Class BedBlockEntity

java.lang.Object
net.minecraft.block.entity.BlockEntity
net.minecraft.block.entity.BedBlockEntity

public class BedBlockEntity extends BlockEntity
Mappings:
Namespace Name
named net/minecraft/block/entity/BedBlockEntity
intermediary net/minecraft/class_2587
official dpm
  • Field Details

    • color

      private DyeColor color
      Mappings:
      Namespace Name Mixin selector
      named color Lnet/minecraft/block/entity/BedBlockEntity;color:Lnet/minecraft/util/DyeColor;
      intermediary field_11869 Lnet/minecraft/class_2587;field_11869:Lnet/minecraft/class_1767;
      official a Ldpm;a:Lcsw;
  • Constructor Details

    • BedBlockEntity

      public BedBlockEntity(BlockPos pos, BlockState state)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/block/entity/BedBlockEntity;<init>(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
      intermediary <init> Lnet/minecraft/class_2587;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
      official <init> Ldpm;<init>(Lja;Ldsl;)V
    • BedBlockEntity

      public BedBlockEntity(BlockPos pos, BlockState state, DyeColor color)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/block/entity/BedBlockEntity;<init>(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/DyeColor;)V
      intermediary <init> Lnet/minecraft/class_2587;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_1767;)V
      official <init> Ldpm;<init>(Lja;Ldsl;Lcsw;)V
  • Method Details

    • toUpdatePacket

      public BlockEntityUpdateS2CPacket toUpdatePacket()
      Description copied from class: BlockEntity
      Returns the packet to send to nearby players when the block entity's observable state changes, or null to not send the packet.

      If the data returned by initial chunk data is suitable for updates, the following shortcut can be used to create an update packet: BlockEntityUpdateS2CPacket.create(this). The NBT will be passed to BlockEntity.readNbt(net.minecraft.nbt.NbtCompound, net.minecraft.registry.RegistryWrapper.WrapperLookup) on the client.

      "Observable state" is a state that clients can observe without specific interaction. For example, CampfireBlockEntity's cooked items are observable states, but chests' inventories are not observable states, since the player must first open that chest before they can see the contents.

      To sync block entity data using this method, use serverWorld.getChunkManager().markForUpdate(this.getPos());.

      Overrides:
      toUpdatePacket in class BlockEntity
      Returns:
      the packet to send to nearby players when the block entity's observable state changes, or null to not send the packet
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named toUpdatePacket Lnet/minecraft/block/entity/BedBlockEntity;toUpdatePacket()Lnet/minecraft/network/packet/s2c/play/BlockEntityUpdateS2CPacket;
      intermediary method_38237 Lnet/minecraft/class_2587;method_38237()Lnet/minecraft/class_2622;
      official b Ldpm;b()Labu;
    • getColor

      public DyeColor getColor()
      Mappings:
      Namespace Name Mixin selector
      named getColor Lnet/minecraft/block/entity/BedBlockEntity;getColor()Lnet/minecraft/util/DyeColor;
      intermediary method_11018 Lnet/minecraft/class_2587;method_11018()Lnet/minecraft/class_1767;
      official c Ldpm;c()Lcsw;
    • setColor

      public void setColor(DyeColor color)
      Mappings:
      Namespace Name Mixin selector
      named setColor Lnet/minecraft/block/entity/BedBlockEntity;setColor(Lnet/minecraft/util/DyeColor;)V
      intermediary method_11019 Lnet/minecraft/class_2587;method_11019(Lnet/minecraft/class_1767;)V
      official a Ldpm;a(Lcsw;)V