First, this is a duplicate of MC-123229 which is a duplicate of MC-10755. However, those issues seem to be really old and I want to precise more things compared to MC-123229 that only describes levitation effects. I'm sorry if this isn't helpful but well...
In a singleplayer world, version 1.17.1, full vanilla. This also happens on 1.16.5.
I use /effect give @s minecraft:resistance 1000 128 true, then I check nbt tags and I see the given amplifier is -128, everything is fine.
ActiveEffects: [{Duration: 19853, ShowIcon: 0b, Ambient: 0b, ShowParticles: 0b, Id: 25b, Amplifier: -128b}]
Then I quit, I join again and I check data tags again, this gives something like the following, you see the Amplifier is back to 0.
ActiveEffects: [{Duration: 19853, ShowIcon: 0b, Ambient: 0b, ShowParticles: 0b, Id: 25b, Amplifier: 0b}]
This error happens on every negative Amplifiers, from -128 to -1 (from 128 to 255 in the command /effect). I tested on levitation, resistance and regeneration effects. It's clearly weird on levitation effect, with amplifier -128 you are sticking to the ground and then when you disconnect and reconnect, you fly with levitation level 1 (amplifier 0).
I hope this can be fixed and not marked as "won't fix" because this behavior can break maps, if someone quits and joins (or crashes) he will have a different effects (e.g. he has high resistance or he has to be stuck to the ground). It seems this happens on join only, I check the player data nbt tags when I was logged off and it was set to negative number as expected (but goes to 0 when I relog then save world again).
Thank you !
Linked issues
Comments 4
@Dhranios Not really. Effect 0-255 exists for a long time. But it's a signed 8-bit representation, so from -128 to 127 (instead of 0 - 255 for a non signed). It allows to adapt the effect behavior on negative values instead of checking many cases if this is above 127 and so on. If negative amplifiers was an issue, it would have been fixed, I think...
Actually, duplicate of MC-108704.
Thank you for your report!
We're tracking this issue in MC-108704, so this ticket is being resolved and linked as a duplicate.
That ticket has already been resolved as working as intended, which means this is not considered a bug and won't be fixed. Please do not leave a comment on the linked ticket.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automatically! The ticket was resolved by one of our moderators, and I left this message to give more information to you.
I know for a fact this has been the case for a long time. If anything, the bug here is that negative amplifiers are possible in the first place.