In Java Edition, there is a statistic minecraft:time_since_rest which is used in determining whether the player has the "Insomnia" effect and should cause phantoms to spawn.

Since statistics are a Java-exclusive feature, I'm wondering if there is any way of getting this same information in Bedrock, either from commands or from server-side scripting. (It's for use in an addon, where I'm trying to make an item that interacts with the "Insomnia" game mechanic.)

So, something like the time query command in this answer, but counting from the last bed use or respawn (for a specific player) instead of total time that has passed since the world was initialized, or since dawn.

I don't believe this is currently possible, but would be glad to be proven wrong!


You must log in to answer this question.