[MC-11135] Potion effects with amplifiers above 127 work weird Created: 06/Mar/13  Updated: 08/Jul/20  Resolved: 23/Mar/13

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Snapshot 13w10b
Fix Version/s: None

Type: Bug
Reporter: Domantas Assignee: Unassigned
Resolution: Duplicate Votes: 2
Labels: effect, potion
Environment:

Windows 7


Issue Links:
Duplicate
duplicates MC-10755 Effects with amplifiers over 4 (level... Resolved
CHK:
Confirmation Status: Confirmed

 Description   

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.



 Comments   
Comment by Niklas Wittl [ 08/Jul/20 ]

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

Comment by Squid Eevee [ 15/Oct/13 ]

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

Comment by Jared Jeyaretnam [ 10/Jun/13 ]

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

Comment by Kumasasa [ 23/Mar/13 ]

Duplicate of MC-10755

Comment by Kumasasa [ 06/Mar/13 ]

Confirmed.

Generated at Sun Jan 12 12:26:39 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.