[MC-10462] Using /effect with the amplifier specified gives an effect with higher than expected strength Created: 27/Feb/13  Updated: 17/Jun/21  Resolved: 18/Mar/13

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

Type: Bug
Reporter: Josh Olsen Assignee: Unassigned
Resolution: Works As Intended Votes: 0
Labels: None
Environment:

Windows 8
Java 7 x64


Issue Links:
Cloners
is cloned by MC-51813 The effect amplifier for potions gran... Reopened
Duplicate
is duplicated by MC-12205 Effect command bug Resolved
is duplicated by MC-18029 Absorption effect applied by commands... Resolved
is duplicated by MC-52522 Effect level in commands off by 1 com... Resolved
is duplicated by MC-68731 Effect level Resolved
is duplicated by MC-88071 Command /effect issue Resolved
is duplicated by MC-121800 Using a command to effect something i... Resolved
is duplicated by MC-142104 Amplifier value in commands starts wi... Resolved
is duplicated by MC-147919 When I type the level 5 bad_omen effe... Resolved
is duplicated by MC-171157 The level of the effect with the /Eff... Resolved
is duplicated by MC-196101 /effect command gives 1 more level th... Resolved
Confirmation Status: Unconfirmed

 Description   

If you use the /effect command like so:

/effect <player> 1 10 1

The player gets Speed II for 10 seconds NOT speed I, and if I had said 1 10 2 it would be speed III, and 3 is IV. However 4 is also IV, but dose not show the power level in the inventory screen

I would have expected that 1 = I, 2 = II, 3 = III, etc. However the amplifier adds the number to the base of 1, instead of setting the strength as expected.



 Comments   
Comment by Kumasasa [ 18/Mar/13 ]

Resolved as Working As Intended, since established in version 1.5

Comment by Kumasasa [ 01/Mar/13 ]

In 13w09c the amplifier isn't limited to 4 anymore, it's (nearly) unlimited.

Comment by WolfieMario [ 28/Feb/13 ]

The strange thing is, enchantment IDs start at 0, while potion IDs start at 1. Enchantment levels start at 1, while potion levels start at 0. It really is just inconsistent implementation - presumably, the shift operators used by Instant Health, Instant Harm, Strength, and Weakness were simply easier to code if the default potions were 'level' 0, while enchantments (which do not rely on shift operators for their calculations) were easier to code with 1 as the default.

Comment by [Mod] CubeTheThird [ 28/Feb/13 ]

When I said levels what I mean was indexes of lists/sets.

Comment by WolfieMario [ 28/Feb/13 ]

I think this is probably intended, as the word chosen is explicitly "amplifier" and not "level". I'm not happy about it (it's always been at least a little tedious to work with when NBT editing, especially since it's inconsistent with enchantments), but I think it's intended as it's too late to change the potion effect format (you would ruin backwards and forwards compatibility for any custom map features, or even for players/entities saved to disk with a potion effect).

Comment by [Mod] CubeTheThird [ 28/Feb/13 ]

I am not saying that this is intended, but rather explaining why it works this way. I do however agree that this can be confusing.

Comment by Kumasasa [ 27/Feb/13 ]

Probably intended, the valid range for amplifier is 0..4
Issuing

/effect player 1 5 5

gives

The number you have entered (5) is too big, it must be at most 4
Comment by Josh Olsen [ 27/Feb/13 ]

Not really, because 1 = II, this is wrong. Even when you start at 0, 0 != 1, and 1 != 2. Thus 1 != II, and 2 != III. It is irrelevant that the first level is zero, if you are going to display the level as a number "II" it needs to match up with the number you give it.

Comment by [Mod] CubeTheThird [ 27/Feb/13 ]

This is because, as many things do in computer science, indexes start at 0. Another example is how difficulty easy is 0 , normal 1 and so on.

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