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 cmr
intermediary net/minecraft/class_2586
named net/minecraft/block/entity/BlockEntity
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      official b Lcmr;b:Lorg/slf4j/Logger;
      intermediary field_11868 Lnet/minecraft/class_2586;field_11868:Lorg/slf4j/Logger;
      named LOGGER Lnet/minecraft/block/entity/BlockEntity;LOGGER:Lorg/slf4j/Logger;
    • type

      private final BlockEntityType<?> type
      Mappings:
      Namespace Name Mixin selector
      official c Lcmr;c:Lcmt;
      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 Lcmr;n:Lcav;
      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 Lcmr;o:Lgj;
      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 Lcmr;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 Lcmr;d:Lcov;
      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> Lcmr;<init>(Lcmt;Lgj;Lcov;)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 Lcmr;c(Lok;)Lgj;
      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 Lcmr;k()Lcav;
      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 Lcmr;a(Lcav;)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 Lcmr;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 Lcmr;a(Lok;)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 Lcmr;b(Lok;)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 Lcmr;m()Lok;
      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 Lcmr;n()Lok;
      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 Lcmr;o()Lok;
      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 Lcmr;d(Lok;)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 Lcmr;a(Lok;Lcmt;)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 Lcmr;e(Lbuw;)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 Lcmr;e(Lok;)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 Lcmr;a(Lgj;Lcov;Lok;)Lcmr;
      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 Lcmr;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 Lcmr;a(Lcav;Lgj;Lcov;)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 Lcmr;p()Lgj;
      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 Lcmr;q()Lcov;
      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 Lcmr;h()Lrc;
      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 aa_ Lcmr;aa_()Lok;
      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 Lcmr;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 ab_ Lcmr;ab_()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 Lcmr;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_ Lcmr;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 Lcmr;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 Lcmr;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 Lcmr;u()Lcmt;
      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 Lcmr;b(Lcov;)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