Package net.minecraft

Class class_11074


public class class_11074 extends BlockEntity
Mappings:
Namespace Name
named net/minecraft/class_11074
intermediary net/minecraft/class_11074
official ecx
  • Constructor Details

  • Method Details

    • 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/class_11074;toUpdatePacket()Lnet/minecraft/network/packet/s2c/play/BlockEntityUpdateS2CPacket;
      intermediary method_69756 Lnet/minecraft/class_11074;method_69756()Lnet/minecraft/class_2622;
      official a Lecx;a()Lacn;
    • toInitialChunkDataNbt

      public NbtCompound toInitialChunkDataNbt(RegistryWrapper.WrapperLookup registries)
      Returns the serialized state of this block entity that is observable by clients.

      This is sent alongside the initial chunk data, as well as when the block entity implements toUpdatePacket() and decides to use the default BlockEntityUpdateS2CPacket.

      "Observable state" is a state that clients can observe without specific interaction. For example,

      invalid reference
      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 send all NBT data of this block entity saved to disk, return BlockEntity.createNbt(net.minecraft.registry.RegistryWrapper.WrapperLookup).

      Overrides:
      toInitialChunkDataNbt in class BlockEntity
      Returns:
      the serialized state of this block entity that is observable by clients
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named toInitialChunkDataNbt Lnet/minecraft/block/entity/BlockEntity;toInitialChunkDataNbt(Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Lnet/minecraft/nbt/NbtCompound;
      intermediary method_16887 Lnet/minecraft/class_2586;method_16887(Lnet/minecraft/class_7225$class_7874;)Lnet/minecraft/class_2487;
      official a Lebn;a(Ljj$a;)Luc;
    • method_69757

      @Nullable public @Nullable class_11050 method_69757()
      Mappings:
      Namespace Name Mixin selector
      named method_69757 Lnet/minecraft/class_11074;method_69757()Lnet/minecraft/class_11050;
      intermediary method_69757 Lnet/minecraft/class_11074;method_69757()Lnet/minecraft/class_11050;
      official c Lecx;c()Lddi;