ForEachEntity
#1
i was thinking since there is no World:ForEachEntity anymore becouse of the per-chunk entity ticking maybe there could be a World:ForEachChunk and a Chunk:ForEachEntity. or would this be realy slow?
Reply
Thanks given by:
#2
cWorld:ForEachEntity() has been kept and should work alright. And I'm a bit skeptical about exporting chunks - usually you don't need them, you need something a bit more high-level, so why not implement the higher level function optimized? Also, with chunks, one needs to be extra careful not to break any relations between them.
Reply
Thanks given by:
#3
what is a higher level function?
Reply
Thanks given by:
#4
Usually you want to do something with the chunk, for example "make an explosion". So "MakeAnExplosion" would be a higher level function, while "GetChunk, DigBlock, SetBlock" would be the lower level functions which you could use for the same purpose. Naturally, higher level functions are easier to use, but are not so universal. They are good because usually they can be more optimized.
Reply
Thanks given by:
#5
Are mobs also counted as Entitys by ForEachEntity? becouse i spawned a bunch of mobs and then i let the server do print( i ) i = i + 1 but it only printed like 2 times.
Reply
Thanks given by:
#6
Everything should be counted, but only in the loaded chunks.
Reply
Thanks given by:




Users browsing this thread: 2 Guest(s)