Class BlockEntity

java.lang.Object
net.minecraft.block.entity.BlockEntity
Direct Known Subclasses:
BannerBlockEntity, BeaconBlockEntity, BedBlockEntity, BeehiveBlockEntity, BellBlockEntity, CampfireBlockEntity, CommandBlockBlockEntity, ComparatorBlockEntity, ConduitBlockEntity, DaylightDetectorBlockEntity, EnchantingTableBlockEntity, EnderChestBlockEntity, EndPortalBlockEntity, JigsawBlockEntity, JukeboxBlockEntity, LecternBlockEntity, LockableContainerBlockEntity, MobSpawnerBlockEntity, PistonBlockEntity, SculkSensorBlockEntity, SignBlockEntity, SkullBlockEntity, StructureBlockBlockEntity

public abstract class BlockEntity extends Object
Mappings:
Namespace Name
official cls
intermediary net/minecraft/class_2586
named net/minecraft/block/entity/BlockEntity
  • Field Details

    • LOGGER

      private static final Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      official b Lcls;b:Lorg/apache/logging/log4j/Logger;
      intermediary field_11868 Lnet/minecraft/class_2586;field_11868:Lorg/apache/logging/log4j/Logger;
      named LOGGER Lnet/minecraft/block/entity/BlockEntity;LOGGER:Lorg/apache/logging/log4j/Logger;
    • type

      private final BlockEntityType<?> type
      Mappings:
      Namespace Name Mixin selector
      official c Lcls;c:Lclu;
      intermediary field_11864 Lnet/minecraft/class_2586;field_11864:Lnet/minecraft/class_2591;
      named type Lnet/minecraft/block/entity/BlockEntity;type:Lnet/minecraft/block/entity/BlockEntityType;
    • world

      @Nullable protected @Nullable World world
      Mappings:
      Namespace Name Mixin selector
      official n Lcls;n:Lbzw;
      intermediary field_11863 Lnet/minecraft/class_2586;field_11863:Lnet/minecraft/class_1937;
      named world Lnet/minecraft/block/entity/BlockEntity;world:Lnet/minecraft/world/World;
    • pos

      protected final BlockPos pos
      Mappings:
      Namespace Name Mixin selector
      official o Lcls;o:Lgh;
      intermediary field_11867 Lnet/minecraft/class_2586;field_11867:Lnet/minecraft/class_2338;
      named pos Lnet/minecraft/block/entity/BlockEntity;pos:Lnet/minecraft/util/math/BlockPos;
    • removed

      protected boolean removed
      Mappings:
      Namespace Name Mixin selector
      official p Lcls;p:Z
      intermediary field_11865 Lnet/minecraft/class_2586;field_11865:Z
      named removed Lnet/minecraft/block/entity/BlockEntity;removed:Z
    • cachedState

      private BlockState cachedState
      Mappings:
      Namespace Name Mixin selector
      official d Lcls;d:Lcnv;
      intermediary field_11866 Lnet/minecraft/class_2586;field_11866:Lnet/minecraft/class_2680;
      named cachedState Lnet/minecraft/block/entity/BlockEntity;cachedState:Lnet/minecraft/block/BlockState;
  • Constructor Details

    • BlockEntity

      public BlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lcls;<init>(Lclu;Lgh;Lcnv;)V
      intermediary <init> Lnet/minecraft/class_2586;<init>(Lnet/minecraft/class_2591;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
      named <init> Lnet/minecraft/block/entity/BlockEntity;<init>(Lnet/minecraft/block/entity/BlockEntityType;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
  • Method Details

    • posFromNbt

      public static BlockPos posFromNbt(NbtCompound nbt)
      Mappings:
      Namespace Name Mixin selector
      official c Lcls;c(Lob;)Lgh;
      intermediary method_38239 Lnet/minecraft/class_2586;method_38239(Lnet/minecraft/class_2487;)Lnet/minecraft/class_2338;
      named posFromNbt Lnet/minecraft/block/entity/BlockEntity;posFromNbt(Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/util/math/BlockPos;
    • getWorld

      @Nullable public @Nullable World getWorld()
      Mappings:
      Namespace Name Mixin selector
      official k Lcls;k()Lbzw;
      intermediary method_10997 Lnet/minecraft/class_2586;method_10997()Lnet/minecraft/class_1937;
      named getWorld Lnet/minecraft/block/entity/BlockEntity;getWorld()Lnet/minecraft/world/World;
    • setWorld

      public void setWorld(World world)
      Mappings:
      Namespace Name Mixin selector
      official a Lcls;a(Lbzw;)V
      intermediary method_31662 Lnet/minecraft/class_2586;method_31662(Lnet/minecraft/class_1937;)V
      named setWorld Lnet/minecraft/block/entity/BlockEntity;setWorld(Lnet/minecraft/world/World;)V
    • hasWorld

      public boolean hasWorld()
      Mappings:
      Namespace Name Mixin selector
      official l Lcls;l()Z
      intermediary method_11002 Lnet/minecraft/class_2586;method_11002()Z
      named hasWorld Lnet/minecraft/block/entity/BlockEntity;hasWorld()Z
    • readNbt

      public void readNbt(NbtCompound nbt)
      Mappings:
      Namespace Name Mixin selector
      official a Lcls;a(Lob;)V
      intermediary method_11014 Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_2487;)V
      named readNbt Lnet/minecraft/block/entity/BlockEntity;readNbt(Lnet/minecraft/nbt/NbtCompound;)V
    • writeNbt

      protected void writeNbt(NbtCompound nbt)
      Mappings:
      Namespace Name Mixin selector
      official b Lcls;b(Lob;)V
      intermediary method_11007 Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_2487;)V
      named writeNbt Lnet/minecraft/block/entity/BlockEntity;writeNbt(Lnet/minecraft/nbt/NbtCompound;)V
    • createNbtWithIdentifyingData

      public final NbtCompound createNbtWithIdentifyingData()
      Mappings:
      Namespace Name Mixin selector
      official m Lcls;m()Lob;
      intermediary method_38242 Lnet/minecraft/class_2586;method_38242()Lnet/minecraft/class_2487;
      named createNbtWithIdentifyingData Lnet/minecraft/block/entity/BlockEntity;createNbtWithIdentifyingData()Lnet/minecraft/nbt/NbtCompound;
    • createNbtWithId

      public final NbtCompound createNbtWithId()
      Mappings:
      Namespace Name Mixin selector
      official n Lcls;n()Lob;
      intermediary method_38243 Lnet/minecraft/class_2586;method_38243()Lnet/minecraft/class_2487;
      named createNbtWithId Lnet/minecraft/block/entity/BlockEntity;createNbtWithId()Lnet/minecraft/nbt/NbtCompound;
    • createNbt

      public final NbtCompound createNbt()
      Mappings:
      Namespace Name Mixin selector
      official o Lcls;o()Lob;
      intermediary method_38244 Lnet/minecraft/class_2586;method_38244()Lnet/minecraft/class_2487;
      named createNbt Lnet/minecraft/block/entity/BlockEntity;createNbt()Lnet/minecraft/nbt/NbtCompound;
    • writeIdToNbt

      private void writeIdToNbt(NbtCompound nbt)
      Mappings:
      Namespace Name Mixin selector
      official d Lcls;d(Lob;)V
      intermediary method_38241 Lnet/minecraft/class_2586;method_38241(Lnet/minecraft/class_2487;)V
      named writeIdToNbt Lnet/minecraft/block/entity/BlockEntity;writeIdToNbt(Lnet/minecraft/nbt/NbtCompound;)V
    • writeIdToNbt

      public static void writeIdToNbt(NbtCompound nbt, BlockEntityType<?> type)
      Mappings:
      Namespace Name Mixin selector
      official a Lcls;a(Lob;Lclu;)V
      intermediary method_38238 Lnet/minecraft/class_2586;method_38238(Lnet/minecraft/class_2487;Lnet/minecraft/class_2591;)V
      named writeIdToNbt Lnet/minecraft/block/entity/BlockEntity;writeIdToNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/block/entity/BlockEntityType;)V
    • setStackNbt

      public void setStackNbt(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      official e Lcls;e(Lbtx;)V
      intermediary method_38240 Lnet/minecraft/class_2586;method_38240(Lnet/minecraft/class_1799;)V
      named setStackNbt Lnet/minecraft/block/entity/BlockEntity;setStackNbt(Lnet/minecraft/item/ItemStack;)V
    • writeIdentifyingData

      private void writeIdentifyingData(NbtCompound nbt)
      Mappings:
      Namespace Name Mixin selector
      official e Lcls;e(Lob;)V
      intermediary method_10999 Lnet/minecraft/class_2586;method_10999(Lnet/minecraft/class_2487;)V
      named writeIdentifyingData Lnet/minecraft/block/entity/BlockEntity;writeIdentifyingData(Lnet/minecraft/nbt/NbtCompound;)V
    • createFromNbt

      @Nullable public static @Nullable BlockEntity createFromNbt(BlockPos pos, BlockState state, NbtCompound nbt)
      Mappings:
      Namespace Name Mixin selector
      official a Lcls;a(Lgh;Lcnv;Lob;)Lcls;
      intermediary method_11005 Lnet/minecraft/class_2586;method_11005(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_2487;)Lnet/minecraft/class_2586;
      named createFromNbt Lnet/minecraft/block/entity/BlockEntity;createFromNbt(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/block/entity/BlockEntity;
    • markDirty

      public void markDirty()
      Mappings:
      Namespace Name Mixin selector
      official e Lcls;e()V
      intermediary method_5431 Lnet/minecraft/class_2586;method_5431()V
      named markDirty Lnet/minecraft/block/entity/BlockEntity;markDirty()V
    • markDirty

      protected static void markDirty(World world, BlockPos pos, BlockState state)
      Mappings:
      Namespace Name Mixin selector
      official a Lcls;a(Lbzw;Lgh;Lcnv;)V
      intermediary method_31663 Lnet/minecraft/class_2586;method_31663(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
      named markDirty Lnet/minecraft/block/entity/BlockEntity;markDirty(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
    • getPos

      public BlockPos getPos()
      Mappings:
      Namespace Name Mixin selector
      official p Lcls;p()Lgh;
      intermediary method_11016 Lnet/minecraft/class_2586;method_11016()Lnet/minecraft/class_2338;
      named getPos Lnet/minecraft/block/entity/BlockEntity;getPos()Lnet/minecraft/util/math/BlockPos;
    • getCachedState

      public BlockState getCachedState()
      Mappings:
      Namespace Name Mixin selector
      official q Lcls;q()Lcnv;
      intermediary method_11010 Lnet/minecraft/class_2586;method_11010()Lnet/minecraft/class_2680;
      named getCachedState Lnet/minecraft/block/entity/BlockEntity;getCachedState()Lnet/minecraft/block/BlockState;
    • toUpdatePacket

      Implement and return a packet that should be sent to players nearby when the observable state of this block entity changes. Return null to not send an update 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 readNbt(net.minecraft.nbt.NbtCompound) on the client.

      Mappings:
      Namespace Name Mixin selector
      official h Lcls;h()Lql;
      intermediary method_38235 Lnet/minecraft/class_2586;method_38235()Lnet/minecraft/class_2596;
      named toUpdatePacket Lnet/minecraft/block/entity/BlockEntity;toUpdatePacket()Lnet/minecraft/network/Packet;
    • toInitialChunkDataNbt

      public NbtCompound toInitialChunkDataNbt()
      Serializes the state of this block entity that is observable by clients. It is sent alongside the initial chunk data, as well as when the block entity implements toUpdatePacket() and decides to use the default BlockEntityUpdateS2CPacket.
      Mappings:
      Namespace Name Mixin selector
      official Z_ Lcls;Z_()Lob;
      intermediary method_16887 Lnet/minecraft/class_2586;method_16887()Lnet/minecraft/class_2487;
      named toInitialChunkDataNbt Lnet/minecraft/block/entity/BlockEntity;toInitialChunkDataNbt()Lnet/minecraft/nbt/NbtCompound;
    • isRemoved

      public boolean isRemoved()
      Mappings:
      Namespace Name Mixin selector
      official r Lcls;r()Z
      intermediary method_11015 Lnet/minecraft/class_2586;method_11015()Z
      named isRemoved Lnet/minecraft/block/entity/BlockEntity;isRemoved()Z
    • markRemoved

      public void markRemoved()
      Mappings:
      Namespace Name Mixin selector
      official aa_ Lcls;aa_()V
      intermediary method_11012 Lnet/minecraft/class_2586;method_11012()V
      named markRemoved Lnet/minecraft/block/entity/BlockEntity;markRemoved()V
    • cancelRemoval

      public void cancelRemoval()
      Mappings:
      Namespace Name Mixin selector
      official s Lcls;s()V
      intermediary method_10996 Lnet/minecraft/class_2586;method_10996()V
      named cancelRemoval Lnet/minecraft/block/entity/BlockEntity;cancelRemoval()V
    • onSyncedBlockEvent

      public boolean onSyncedBlockEvent(int type, int data)
      Mappings:
      Namespace Name Mixin selector
      official a_ Lcls;a_(II)Z
      intermediary method_11004 Lnet/minecraft/class_2586;method_11004(II)Z
      named onSyncedBlockEvent Lnet/minecraft/block/entity/BlockEntity;onSyncedBlockEvent(II)Z
    • populateCrashReport

      public void populateCrashReport(CrashReportSection crashReportSection)
      Mappings:
      Namespace Name Mixin selector
      official a Lcls;a(Lr;)V
      intermediary method_11003 Lnet/minecraft/class_2586;method_11003(Lnet/minecraft/class_129;)V
      named populateCrashReport Lnet/minecraft/block/entity/BlockEntity;populateCrashReport(Lnet/minecraft/util/crash/CrashReportSection;)V
    • copyItemDataRequiresOperator

      public boolean copyItemDataRequiresOperator()
      Mappings:
      Namespace Name Mixin selector
      official t Lcls;t()Z
      intermediary method_11011 Lnet/minecraft/class_2586;method_11011()Z
      named copyItemDataRequiresOperator Lnet/minecraft/block/entity/BlockEntity;copyItemDataRequiresOperator()Z
    • getType

      public BlockEntityType<?> getType()
      Mappings:
      Namespace Name Mixin selector
      official u Lcls;u()Lclu;
      intermediary method_11017 Lnet/minecraft/class_2586;method_11017()Lnet/minecraft/class_2591;
      named getType Lnet/minecraft/block/entity/BlockEntity;getType()Lnet/minecraft/block/entity/BlockEntityType;
    • setCachedState

      @Deprecated public void setCachedState(BlockState state)
      Deprecated.
      Mappings:
      Namespace Name Mixin selector
      official b Lcls;b(Lcnv;)V
      intermediary method_31664 Lnet/minecraft/class_2586;method_31664(Lnet/minecraft/class_2680;)V
      named setCachedState Lnet/minecraft/block/entity/BlockEntity;setCachedState(Lnet/minecraft/block/BlockState;)V