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 TypeMethodDescriptionvoidfromClientTag(net.minecraft.nbt.NbtCompound tag)default voidsync()When called on the server, schedules a BlockEntity sync to client.net.minecraft.nbt.NbtCompoundtoClientTag(net.minecraft.nbt.NbtCompound tag)
-
Method Details
-
fromClientTag
void fromClientTag(net.minecraft.nbt.NbtCompound tag) -
toClientTag
net.minecraft.nbt.NbtCompound toClientTag(net.minecraft.nbt.NbtCompound tag) -
sync
default void sync()When called on the server, schedules a BlockEntity sync to client. This will causetoClientTag(NbtCompound)to be called on the server to generate the packet data, and thenfromClientTag(NbtCompound)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.
-