Skip to content

Add ability to change time (date) format in command blocks #13269

Description

@molor

Is your feature request related to a problem?

It's only for our convenience.

Currently command output in command blocks are prefixed only by local system time.
I want to add a date to this prefix, i.e. [2025-11-02 11:00:01] Example output.

There's no way to do that even via Reflection API, because instance of DateTimeFormatter TIME_FORMAT in BaseCommandBlock.CloseableCommandBlockSource isn't mutable anymore (in 1.21.8, SimpleDateFormat was used for this purpose and it was possible to change its pattern).

Describe the solution you'd like.

Add command-block-time-pattern to the server per-world configuration.

Describe alternatives you've considered.

Add an internal method to change value of the TIME_FORMAT field via Reflection API and make it non-final.

Other

No response

Activity

  1. added theissue type on Nov 2, 2025
  2. changed the title [-]Add ability to change time (date_ format in command blocks[/-] [+]Add ability to change time (date) format in command blocks[/+] on Nov 2, 2025
  3. molor commented on Nov 8, 2025

    @molor
    Author

    Since this issue is still bothering me & my players, here's another one, a much simpler alternative:

    Add non-cancellable CommandBlockOutputEvent with getBlock method, which gets called in BaseCommandBlock.java between lines 230 and 231:

    230 BaseCommandBlock.this.lastOutput = Component.literal("[" + TIME_FORMAT.format(ZonedDateTime.now()) + "] ").append(message);
    --- // here
    231 BaseCommandBlock.this.onUpdated();

    And it will be possible to change the output (i.e. add a date) via plugin before block will be updated in the world.

    In this case, it will also add the ability to log messages sent to blocks, in case someone needs it in the future.

  4. molor commented on Feb 24, 2026

    @molor
    Author

    (can anyone who has free time take a look at this, please? :c)

  5. added
    status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.
    and removed on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.

    Fields

    No fields configured for Feature.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions