Interface BlockEntityClientSerializable


public interface BlockEntityClientSerializable
Implement this interface on a BlockEntity which you would like to be synchronized with the client side using the built-in engine methods.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    fromClientTag​(net.minecraft.nbt.CompoundTag tag)
     
    default void
    When called on the server, schedules a BlockEntity sync to client.
    net.minecraft.nbt.CompoundTag
    toClientTag​(net.minecraft.nbt.CompoundTag tag)
     
  • Method Details

    • fromClientTag

      void fromClientTag(net.minecraft.nbt.CompoundTag tag)
    • toClientTag

      net.minecraft.nbt.CompoundTag toClientTag(net.minecraft.nbt.CompoundTag tag)
    • sync

      default void sync()
      When called on the server, schedules a BlockEntity sync to client. This will cause toClientTag(CompoundTag) to be called on the server to generate the packet data, and then fromClientTag(CompoundTag) on the client to decode that data.

      This is preferable to World.updateListeners(net.minecraft.util.math.BlockPos, net.minecraft.block.BlockState, net.minecraft.block.BlockState, int) because it does not cause entities to update their pathing as a side effect.