mojira.dev
MC-306177

The infinite duration of the effect given by the commands is actually not infinite, but negative.

Since version 1.19.4, when you give yourself an effect with commands and specify its duration, you don't have to write a lot of numbers like “1000000”, but just write the word infinite and execute the command, after which you will have an effect that will never end (exceptions such as changing dimensions, death, drinking a bucket of milk and I don't count the use of the totem of immortality), and in the inventory, instead of the duration of the effect, the infinity symbol is indicated in numbers. But in fact, when you give yourself an infinite duration effect using commands, you get a negative duration effect. You can verify this by replaying the following steps:

Give yourself a fire resistance effect for an infinite duration by executing the command: /effect give @s minecraft:luck infinite 0

Find out what effects are affecting you by running the command: /data get entity @s active_effects

Please note that the /data command will inform you that you have a luck effect with a duration of -1, and as we all know, -1 is a negative number.

Attachments

Comments 3

Thank you for helping us improve Minecraft! We saved your files:

[media][media]

Can confirm as of 26.1-snapshot-6 although I don’t believe this is a bug since they likely have it set to check for negative numbers in the code and apply the infinite effect to any negative numbers.
Also, the infinite effect still applies so I would assume this is working as intended.

However, I am not a mod and can not confirm whether it is or not.

minecraft_982646

(Unassigned)

Confirmed

(Unassigned)

26.1 Snapshot 5, 26.1 Snapshot 6

Retrieved