Skip to content

Fix signs displaying JSON text on Minecraft 1.21.5+ - #3605

Open
twme-ai wants to merge 2 commits into
IntellectualSites:mainfrom
twme-ai:fix/3379-sign-text-serialization
Open

Fix signs displaying JSON text on Minecraft 1.21.5+#3605
twme-ai wants to merge 2 commits into
IntellectualSites:mainfrom
twme-ai:fix/3379-sign-text-serialization

Conversation

@twme-ai

@twme-ai twme-ai commented Jul 30, 2026

Copy link
Copy Markdown

Overview

Fixes #3379

Description

Minecraft 1.21.5 changed the representation of text components in sign NBT. A string now represents a literal
text component instead of JSON-encoded text. SignBlock continued wrapping each line in JSON inside the NBT
string, which caused commands such as //set spruce_sign to display the JSON source on the sign.

This change preserves the JSON-in-string representation before Minecraft 1.21.5 and writes literal strings on
Minecraft 1.21.5 and newer. It also uses the version-appropriate empty value when constructing signs or loading
incomplete sign NBT.

Regression tests cover Minecraft 1.21.4, the 1.21.5 format boundary, 1.21.10, 1.21.11, and 26.1.2.

Testing

  • ./gradlew :worldedit-core:check --no-configure-on-demand
  • Paper integration tests on 1.21.4, 1.21.5, 1.21.10, 1.21.11, and 26.1.2

Submitter Checklist

  • Make sure you are opening from a topic branch (/feature/fix/docs/ branch (right side)) and not your main branch.
  • Ensure that the pull request title represents the desired changelog entry.
  • New public fields and methods are annotated with @since TODO.
  • I read and followed the contribution guidelines.

@twme-ai
twme-ai requested a review from a team as a code owner July 30, 2026 13:41
@NotMyFault
NotMyFault requested a review from Copilot July 30, 2026 13:43

Copilot AI left a comment

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.

Pull request overview

Updates legacy SignBlock NBT serialization to account for Minecraft 1.21.5’s change where sign text NBT strings are treated as literal components (not JSON-in-string), preventing signs placed via commands like //set spruce_sign from showing JSON source on 1.21.5+.

Changes:

  • Make SignBlock write JSON-in-string text for < 1.21.5 and literal strings for >= 1.21.5, including version-appropriate empty defaults.
  • Add regression tests covering multiple data versions around the 1.21.5 boundary and newer versions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java Switch sign text encoding/empties based on data version to match 1.21.5+ semantics.
worldedit-core/src/test/java/com/sk89q/worldedit/blocks/SignBlockTest.java Add tests validating JSON vs literal sign message serialization across multiple versions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread worldedit-core/src/test/java/com/sk89q/worldedit/blocks/SignBlockTest.java Outdated
Comment thread worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java Outdated
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.

Signs set via //set command contain empty text JSON

2 participants