mojira.dev
MC-10462

Using /effect with the amplifier specified gives an effect with higher than expected strength

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.

Linked issues

Comments 9

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.

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.

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

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.

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).

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

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.

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

Resolved as Working As Intended, since established in version 1.5

Josh Olsen

(Unassigned)

Unconfirmed

Snapshot 13w09b

Retrieved