So. I just spent. Three days. Trying to add TextDisplays that have a timer to countdown to the next time that the chest or blocks refresh. This should be simple, right? No! Because the text would never update. No matter how hard I tried. I tried everything. Setting a bunch of different values on the entity. Teleporting it to its own location in an attempt to force-update it. And the weirdest part? It would update? A few times? But only in the other teams bases, in unloaded chunks, the text would have updated once! Did any of this make sense? No. I was getting desperate. I was considering deleting and recreating the display entity every single second to update the text. I was considering setting raw packets to the client. I was considering just using a regular sign block. I was considering using an invisible armor stand with a custom name, like how things worked before TextDisplays existed. But no. Nothing worked. The amount of pain I went through to get something as simple as a damn text display to update its text. I debugged everything. Logged the entity. It existed. It was in this world, at the coordinates I put it in. I logged the text. It was the text that was being set. And yet. It wasn’t updating. I check the data in game with the /data command. The text does not update. Nothing make sense. Nothing at all. Hate. Hate.
So then I ask DevCmb for help for the 9,223,372,036,854,775,807th time. We try a bunch of really stupid things. None of them work. Until, he changes the spawnEntity call with spawn. I thought this was just different syntax.
No.
That fixed everything.
Something to do with spawning entities in unloaded chunks.
I don’t get it. I don’t know why that fixes it. It might be a bug with Paper itself. I have no idea. Hate. Hate.
………………………….
anyway uh yea tldr theres textdisplays that show restock timers and i went through a lot of pain and i can FINALLY work on other stuff now OH MY CODDDD