mojira.dev
MC-121611

/effect with large 'time' values produces inconsistent behaviour

/effect @p regeneration 999999 1 (for example) will give regeneration (level 2) indefinitely.

BUT, if I already have the regeneration effect (level 1), and I input this command, the higher-level regen overrides it. This is expected behaviour, but what is unexpected is that the level 2 regen, instead of lasting indefinitely, lasts for about 27 minutes. (It's worth noting that this is much less than both 999999 seconds and 999999 ticks).

So, either 999999 should always mean 'indefinite time', OR it should actually mean 999999 seconds (this is 11.5 IRL days) and 'indefinite time' should have a special value like -1.

STEPS TO REPRODUCE (1.12.1)
1. /effect @p regeneration 60 0
2. /effect @p regeneration 999999 1

STEPS TO REPRODUCE (17W45A)
1. /effect give @p regeneration 60 0
2. /effect give @p regeneration 999999 1

EDIT: The 28-minute value it comes up with is about 1600 seconds. Inputting any time value higher than this produces identical results, so it must be some issue with handling numbers over 1600 seconds (I think because it sees that as about 32768 ticks, which is 2^15 and may cause a buffer overflow error? Or something? I don't know.)

EDIT 2: So, apparently 999999 seconds only causes a problem with the display, not the actual timer - it still actually lasts for 999999 seconds. Fair enough, but the fact that it only gives you 27 minutes if you already have the lower-level effect is still a bug.

EDIT 3: Bug also occurs in new 1.13 snapshot.

Linked issues

Comments

Skylinerw

The display shows **:** when the number of ticks exceeds 32,767; it does not mean the effect lasts infinitely, just that the duration is too large to show. 999,999 seconds is 19,999,980 ticks, which exceeds the 32,767 limit. To be clear, this is just for the display, as the actual timer has a working max of 2,147,483,647.

mxblue28

Thanks for the extra info!

However, the bug I was trying to report was that if you already have a lower-level effect, the new effect only lasts for 27 minutes.

Skylinerw

Hmm, I cannot reproduce that issue. The timer always stays at the expected **:** no matter what combination of effect amplifiers I try. Can you provide step-by-step reproduction, as well as if you're in multiplayer?

mxblue28

Cannot confirm for multiplayer, do not have command ability on any servers.
Have included specific commands (chat console and command blocks both work)

marcono1234

Duplicates MC-44936

mxblue28

(Unassigned)

Unconfirmed

Minecraft 1.12.2, Minecraft 17w45a

Retrieved