Skip to content

Conversation

@sovdeeth
Copy link
Member

Problem

Text display opacity is very confusing and hard to work with, since it goes from fully transparent at 4, to half opaque at 127, to half opaque at -128, to fully opaque at -1. Re-ranging this to be a simple 4-255 scale would be much easier for users to use and understand (it's what snbt does, too!)

Really, this should have been done from the start.

Solution

Returns opacities from 0 to 255 now, adding 256 to any value < 0. This is a breaking change.
Setting opacity still supports -127 to -1, but adding/subtracting will limit the values to 0 to 255.

The alternative is to allow as much wrapping as desired (eg, subtracting 300 will loop all the way around and be equal to subtracting 44, and users can set the opacity to any value they want and it will be modulo-ed to 0-255). This is versatile but very counter-intuitive for new users. Setting opacity to 300 and getting a result of 44 doesn't make much sense. It's still a minor issue in the current impl, where you can set to -10 and get 246, but that's for backwards compat and can be forgiven imo.

Testing Completed

ExprTextDisplayOpacity.sk

Supporting Information

Created after 2 users reported significant issues trying to deal with text opacity in skunity help channels.


Completes: none
Related: none
AI assistance: none

@sovdeeth sovdeeth requested a review from a team as a code owner December 23, 2025 21:50
@sovdeeth sovdeeth added enhancement Feature request, an issue about something that could be improved, or a PR improving something. breaking changes Pull or feature requests that contain breaking changes (API, syntax, etc.) labels Dec 23, 2025
@sovdeeth sovdeeth removed the request for review from a team December 23, 2025 21:50
@sovdeeth sovdeeth added the 2.14 Targeting a 2.14.X version release. label Dec 23, 2025
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label Dec 23, 2025
@sovdeeth sovdeeth moved this to In Review in 2.14 Releases Dec 23, 2025
@miberss
Copy link

miberss commented Dec 23, 2025

It goes fully transparent at 25 for me?

image image

@sovdeeth
Copy link
Member Author

It goes fully transparent at 25 for me?

Yes, it should be fully transparent at 25

Values from 4 to 26 are fully transparent, and opacity increases linearly from there up to 255.

@miberss
Copy link

miberss commented Dec 23, 2025

It goes fully transparent at 25 for me?

Yes, it should be fully transparent at 25

Values from 4 to 26 are fully transparent, and opacity increases linearly from there up to 255.

Whoops, missed.

Why specifically 4 to 26 and not 1 to 26?

@sovdeeth
Copy link
Member Author

It goes fully transparent at 25 for me?

Yes, it should be fully transparent at 25

Values from 4 to 26 are fully transparent, and opacity increases linearly from there up to 255.

Whoops, missed.

Why specifically 4 to 26 and not 1 to 26?

idk mate ask mojang, baffles me too

text_opacity: Alpha value of rendered text. Value ranges from 0 to 255. Values up to 3 are treated as fully opaque (255). Similar to the background, the text rendering is discarded for values between 4 and 26. NBT stores the value as signed byte, -128 to 127. Defaults to -1, which represents 255 and is completely opaque. SNBT to NBT handles conversion from unsigned to signed, but if needed, replace values greater than 127 with alpha-256 or alphaUB. Interpolated.

@miberss
Copy link

miberss commented Dec 23, 2025

It goes fully transparent at 25 for me?

Yes, it should be fully transparent at 25

Values from 4 to 26 are fully transparent, and opacity increases linearly from there up to 255.

Whoops, missed.
Why specifically 4 to 26 and not 1 to 26?

idk mate ask mojang, baffles me too

text_opacity: Alpha value of rendered text. Value ranges from 0 to 255. Values up to 3 are treated as fully opaque (255). Similar to the background, the text rendering is discarded for values between 4 and 26. NBT stores the value as signed byte, -128 to 127. Defaults to -1, which represents 255 and is completely opaque. SNBT to NBT handles conversion from unsigned to signed, but if needed, replace values greater than 127 with alpha-256 or alphaUB. Interpolated.

I swear I read it, super sorry lol.

@github-project-automation github-project-automation bot moved this from In Review to Awaiting Merge in 2.14 Releases Dec 24, 2025
@skriptlang-automation skriptlang-automation bot added feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. and removed needs reviews A PR that needs additional reviews labels Dec 24, 2025
@sovdeeth sovdeeth merged commit 5a5c531 into SkriptLang:dev/feature Dec 31, 2025
9 checks passed
@skriptlang-automation skriptlang-automation bot added the completed The issue has been fully resolved and the change will be in the next Skript update. label Dec 31, 2025
@github-project-automation github-project-automation bot moved this from Awaiting Merge to Done - Awaiting Release in 2.14 Releases Dec 31, 2025
@skriptlang-automation skriptlang-automation bot removed the feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. label Dec 31, 2025
@APickledWalrus APickledWalrus moved this from Done - Awaiting Release to Done - Released in 2.14 Releases Jan 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.14 Targeting a 2.14.X version release. breaking changes Pull or feature requests that contain breaking changes (API, syntax, etc.) completed The issue has been fully resolved and the change will be in the next Skript update. enhancement Feature request, an issue about something that could be improved, or a PR improving something.

Projects

Status: Done - Released

Development

Successfully merging this pull request may close these issues.

4 participants