You can add extra data to the spawn packet Forge sends by implementing the following interface.
You can add extra data to the spawn packet Forge sends by implementing the following interface.
−
=== IEntityAdditionalSpawnData ===
+
===IEntityAdditionalSpawnData===
−
+
If your entity has data that is needed on the client, but doesn't change over time, then it can be added to the entity spawn packet using this interface. <code><nowiki>writeSpawnData()</nowiki></code> and <code><nowiki>readSpawnData()</nowiki></code> control how the data should be en/decoded to/from the network buffer. Also override <code><nowiki>getAddEntityPacket()</nowiki></code> to return <code><nowiki>NetworkHooks.getEntitySpawningPacket(...)</nowiki></code> for the data to be send.
−
If your entity has data that is needed on the client, but doesn't change over time, then it can be added to the entity spawn packet using this interface. <code><nowiki>writeSpawnData()</nowiki></code> and <code><nowiki>readSpawnData()</nowiki></code> control how the data should be en/decoded to/from the network buffer.