Effect amplifiers are read as byte (-128 to 127) instead of as an integer (-2,147,483,648 to 2,147,483,647) from NBT.
- Give yourself jump boost with an amplifier higher than 127 using /effect
- Try to jump
→ You cannot jump (see also
- Reopen the world
→ You now have jump boost with an amplifier of -128 when read (though will be considered 0 when an amplifier obtained via NBT is less than 0)
Based on 1.12 decompiled using MCP 9.40 PRE 1
The methods net.minecraft.potion.PotionEffect.readCustomPotionEffectFromNBT(NBTTagCompound) and net.minecraft.potion.PotionEffect.writeCustomPotionEffectToNBT(NBTTagCompound) reads/writes the amplifier as a byte, while it is stored in-memory as an integer.