Skip to content

1.21.8 support#139

Merged
creesch merged 6 commits intomainfrom
132-support-for-1215
Jul 26, 2025
Merged

1.21.8 support#139
creesch merged 6 commits intomainfrom
132-support-for-1215

Conversation

@creesch
Copy link
Copy Markdown
Collaborator

@creesch creesch commented Jul 26, 2025

Partially covers #132

Turns out it was quite a bit more involved than I had thought. A bunch of minecraft API changes (big thanks to @talklittle for doing most of the leg work there), a gradle upgrade, which broke a bunch of building which I then also had to fix. But, it should all work now :)

@creesch
Copy link
Copy Markdown
Collaborator Author

creesch commented Jul 26, 2025

Looks like hover events don't work as expected anymore. Going to look into that a bit more.

@creesch
Copy link
Copy Markdown
Collaborator Author

creesch commented Jul 26, 2025

Oh boy @danthedaniel, looks like they switched from camelCasing to snake_case and a bunch of property names also changed.

old

{
  "translate": "chat.type.advancement.task",
  "with": [
    {
      "text": "redacted",
      "hoverEvent": {
        "contents": {
          "type": "minecraft:player",
          "id": [],
          "name": "redacted"
        },
        "action": "show_entity"
      },
      "insertion": "redacted",
      "clickEvent": {
        "action": "suggest_command",
        "value": "/tell redacted "
      }
    },
    {
      "translate": "chat.square_brackets",
      "with": [
        {
          "translate": "advancements.adventure.kill_a_mob.title",
          "hoverEvent": {
            "contents": {
              "translate": "advancements.adventure.kill_a_mob.title",
              "extra": [
                "\n",
                { "translate": "advancements.adventure.kill_a_mob.description" }
              ],
              "color": "green"
            },
            "action": "show_text"
          }
        }
      ],
      "color": "green"
    }
  ]
}

new

{
      "translate": "chat.type.advancement.task",
      "with": [
        {
          "text": "redacted",
          "hover_event": {
            "id": "minecraft:player",
            "uuid": [],
            "name": "redacted",
            "action": "show_entity"
          },
          "insertion": "redacted",
          "click_event": {
            "command": "/tell redacted ",
            "action": "suggest_command"
          }
        },
        {
          "translate": "chat.square_brackets",
          "with": [
            {
              "translate": "advancements.story.obtain_armor.title",
              "hover_event": {
                "value": {
                  "translate": "advancements.story.obtain_armor.title",
                  "extra": [
                    "\n",
                    {
                      "translate": "advancements.story.obtain_armor.description"
                    }
                  ],
                  "color": "green"
                },
                "action": "show_text"
              }
            }
          ],
          "color": "green"
        }
      ]
    }
image

From what I am seeing based on this example alone:

  • hoverEvent became hover_event and now uses value instead of contents in some cases but for users/entities seems flatten things and foregoing contents entirely.
  • clickEvent became click_event and seems to use dedicated fields for actions now instead of value. So in the example it uses command and I think I saw a few others as well.

Basic translations still seem to work, but anything involving hovers and clicks is just plain broken at the moment.

Not quite sure how to approach this yet. I probably want to merge this PR though and then we can figure out how to approach the javascript side in a different issue and PR.

@creesch
Copy link
Copy Markdown
Collaborator Author

creesch commented Jul 26, 2025

Alright did a bit more digging. It looks like it might only be hoverEvent and clickEvent that have changed to hover_event and click_event and then internally they have some structural changes. I'll make an issue for it as well.

contents Changes in hover event

contents as a property has either been removed or renamed.

show_text

Here it looks like they renamed it to value

"hover_event": { "action": "show_text", "value": "Hello world" }

show_item

contents is removed and the content of it now sits directly in show_item

"hover_event": {
  "action": "show_item",
  "id": "entity:id",
  "whatever": "otherProperties",
}

show_entity

Also flattens the object, type has become id and id has become uuid000

"hover_event": {
    "id": "minecraft:player",
    "uuid": [],
    "name": "redacted",
    "action": "show_entity"
}

Click event changes

It looks like value here is replaced for dedicated property names

open_url

Here the property name is url

"click_event": { 
    "action": "open_url", 
    "url": "https://tildes.net" 
}

run_command & suggest_command

Propert name becomes command

"click_event": { 
    "action": "run_command", 
    "command": "/tell creesch" 
}

change_page

Property here becomes page

"click_event": { 
    "action": "change_page", 
    "page": 2 
}

Also might be stricter and not accept a string where it previously did (I am going to guess that if we support this we already are this strict)

copy_to_clipboard

Stays the same, I guess value already was descriptive enough.

@creesch creesch mentioned this pull request Jul 26, 2025
@danthedaniel
Copy link
Copy Markdown
Member

danthedaniel commented Jul 26, 2025

They have it all documented here:

https://minecraft.wiki/w/Text_component_format

@creesch
Copy link
Copy Markdown
Collaborator Author

creesch commented Jul 26, 2025

They have it all documented here:

https://minecraft.wiki/w/Text_component_format

Cool, I think I got most of it already. Can you have a look at the issue as well and let me know what you think best. I can see multiple approaches to this. If you have a good idea I'd be happy to let you take it up as well.

@creesch creesch merged commit a4e637f into main Jul 26, 2025
6 checks passed
WebsocketJsonMessage.ChatServerInfo serverInfo =
MinecraftServerIdentifier.getCurrentServerInfo();
String minecraftVersion = SharedConstants.getGameVersion().getName();
String minecraftVersion = SharedConstants.getGameVersion().name();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed here is using GameVersion name() instead of id(). Is it intentional?

@danthedaniel danthedaniel deleted the 132-support-for-1215 branch February 11, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants