4

I'm experimenting with some redstone and need to get a running display of what the current daytime ticks are. I'm working in a single player creative world.

I can get this manually by running "/time query daytime".

However, when I put the time command into a command block and trigger it with redstone, no output is displayed in the chat.

I've also ensured that "commandBlockOutput" is set to true.

I'll be triggering the command block on a timing circuit. How can I get the results to display in chat or in some other way?

1 Answer 1

1

You can store it in a scoreboard using /execute store.

Preparation:

/scoreboard objectives add scoreboard_name dummy

Storing the time in a scoreboard:

execute store result score $gametime scoreboard_name run time query daytime

And then you can display it like any other score with /tellraw:

tellraw @p {"score":{"name":"$gametime","objective":"scoreboard_name"}}

scoreboard_name is an arbitrary chosen scoreboard name, $gametime an arbitrarily chosen fake player name that cannot possibly be the same as a real player name. Start it with # if you want to hide it from scoreboard sidebar displays.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .