You are not setting the position for the lightning bolt entity. It is probably spawning at 0,0,0
Look at ServerLevel.tickChunk() for how vanilla does it.
I assume you are spawning it on the server?
See https://forge.gemwire.uk/wiki/Making_Entities for how to define the attributes for your entity and other things.
The parameter passed to build() is used by DFU (datafixerupper)
So it's pretty much irrelevant unless Mojang somehow know about your Entity and want to apply a fix to its persistent data. 🙂