mojira.dev
MC-11135

Potion effects with amplifiers above 127 work weird

Potion effects with amplifiers above 127 work weird in the new snapshot.
How to replicate:
1. Type in "/effect player_name 1 10 127". For 10 seconds you will be able to run super fast.
2. Type in "/effect player_name 1 10 128". Notice that FOV gets lowered, and you will be unable to move for the duration (you can still move while not on ground).

I checked this with few effects: speed, jump boost, regeneration and hunger. Effects when amplifier is 128:
Speed: I was unable to move.
Jump boost: I was unable to jump.
Regeneration: Instead of regenerating health super fast, it worked as if level 1 effect
Hunger: Same issue as regeneration.

As amplifier is now capped at 255, I think they use bytes for effect amplifier. Vaues above 127 cause byte to owerflow, thus generating potion effects with negative amplifier values.

Related issues

Comments

kumasasa

Confirmed.

kumasasa

Duplicate of MC-10755

migrated

Since they are signed integers, I think the actual maximum value is 127. after this it overflows to -128.

Squid Eevee

An example is /effect @p 8 [duration] 128 This makes the player unable to jump, but resistant to fall damage.

migrated

I tested It with Healing and Damage potions
and it seems to be that the potion effect is the strongest when 124 (my testing in 1.14 but the same results in 1.16.1)
Values above that are completely broken they will be weaker or really weak.
It not only applies to potions but also to the /summon command when you summon entitys with effects.
I didn't do many test's with the /effect command

migrated

(Unassigned)

Confirmed

effect, potion

Snapshot 13w10b

Retrieved