#getBlock() in unloaded chunks
1 messages · Page 1 of 1 (latest)
I think you have no other solutions, but just a use ticking area or use an entity with tick_world component
For some reason using tick_world on an entity is worse that /tickingarea
But does it have limits on how many to use?
By worse it's not working at all
No right? Choose between these two uses many entities or use tickingarea command and make math if the two ticking areas are besides each other don't make another tickingarea just calculate tyem
Then you did something wrong because that shouldn't happen
Most likely lol
My use case is very minimal. They only need to exist for a few ticks while getting and setting a block, then they are deleted
Lovely... spawnEntity() only works in a loaded chunk...
Are you sarcastic? I can't view the image my internet is shit
No, that's what the docs say, "Throws LocationInUnloadedChunkError"
I guess I'm going to have to just increase the delay on my getBlock() call
Looks like you'll be using a ticking area :)
Yeah, it's just to unreliable atm, Just have an entity exist at the block you want to get
cant you spawn it and then teleport it?
const entity = dimension.spawnEntity('my:loader', loadedPos);
entity.teleport(unloadedPos);
Ended up just spawning an entity when "activating" the block
then killing it when "deactivating"
fair enough
yeah wanted to go no entity, but, oh well
I don't really understand the no spawning in unloaded chunks issue though
probably use command instead of API?
Or you could try to add that your entity has the component minecraft:persistent
Entities are stored inside chunks in the save files. The API won't let you spawn an entity in an unloaded chunk because the entity couldn't actually be saved to the world until the chunk was loaded.
I did a lot of testing with entities that have tick_world enabled and found that it's not very reliable. Sometimes when teleporting my entity it would get "lost" and the area that I teleported it to would not start ticking, making it impossible for me to interact with the entity.
Your best option is to manage ticking areas with the /tickingarea command and just wait for the block location that you need to load.
Fair, I would like to use ticking area, bit it's ttl is to varying, sometimes immediately, sometimes over a second, and it just looks bad for the player
