Interface IEntityWithComplexSpawn

All Known Implementing Classes:
EntityTests.CustomComplexSpawnEntity

public interface IEntityWithComplexSpawn
An interface for Entities that need extra information to be communicated between the server and client when they are spawned.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    readSpawnData(net.minecraft.network.RegistryFriendlyByteBuf additionalData)
    Called by the client when it receives a Entity spawn packet.
    void
    writeSpawnData(net.minecraft.network.RegistryFriendlyByteBuf buffer)
    Called by the server when constructing the spawn packet.
  • Method Details

    • writeSpawnData

      void writeSpawnData(net.minecraft.network.RegistryFriendlyByteBuf buffer)
      Called by the server when constructing the spawn packet. Data should be added to the provided stream.
      Parameters:
      buffer - The packet data stream
    • readSpawnData

      void readSpawnData(net.minecraft.network.RegistryFriendlyByteBuf additionalData)
      Called by the client when it receives a Entity spawn packet. Data should be read out of the stream in the same way as it was written.
      Parameters:
      additionalData - The packet data stream