mojira.dev
MC-19648

The "/effect" command sets time for instant effects to ticks and not to seconds

When the new saturation effect came out, I used command blocks to give me hunger points. It seemed like at amplifier 0 for 1 second I got 1 hunger point. When I put the same effect on a potion using NBT editors, even 1 second at amplifier 0 filled my entire hunger bar, when it should act the same as /effect. The issue is that when the command says the effect was applied for x seconds, it was actually applied for x ticks.

Related issues

MC-28366 /effect Duration Problems/Inconsistency MC-52422 Saturation effect command incorrect seconds MC-62742 /effect command doesn't work well MC-91165 The 'seconds' parameter of /effect is using game-ticks instead of seconds MC-101483 When using /effect, the time of the effect given to a player doesn't match the time it the chat says MC-112194 /effect @p saturation output message is incorrect MC-113578 Effect "seconds" variable uses ticks instead MC-121710 Giveing player saturation effect 1 is now give the play one tick instead of one second MC-138654 "seconds" argument in /effect command is applied as ticks with some effects MC-167431 1.15 pre7 wrong duration saturation effect MC-167658 Effect Durations Not Matching MC-172361 Giving yourself Instant Damage, Instant Health, or Saturation via commands won't give the correct duration MC-173630 /effect command bug MC-199526 saturation effect only yields 1/20 of the expected time MC-231749 /effect give saturation is applied for wrong duration MC-231906 The <seconds> parameter in /effect now represents ticks instead of seconds MC-259537 Applied saturation effect to player by tick instead by second when using effect command MC-273148 Incorrect effect duration in /effect give MC-276153 /effect give saturation is applied in ticks instead of secods

Attachments

Comments

migrated
[media]
migrated

The actual issue is that the potion is using ticks instead of the reported "seconds". Observe that a potion at 10 ticks will heal the same as an /effect with 10 "seconds". 1 second is 20 hunger points, while 1 tick is only 1 hunger point.

This issue is present for Instant Health, Instant Harm, and now, Saturation: the command will state that the effect was applied for X seconds, when in reality it was applied for X ticks (1/20 of a second).

Please update your ticket and title to make it clear that the issue is in the command for these effects - custom potions have consistent behavior for all effects, but the command does not.

Ezekiel

Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

migrated

Confirmed for 1.6.2.

kumasasa

Confirmed.

galaxy_2alex

Is this still a concern in the current Minecraft version 1.7.4 / Launcher version 1.3.8 or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

migrated

Confirmed for 1.7.4 and 14w04b.

I have a feeling it's intentionally per-tick to allow for fine-grained control (the effects are all "instantaneous", so even the minimum of 1 second would be 20 doses of Instant Health/Harm/Saturation). However, the message claims "seconds", and should be changed to "ticks" for these effects even if it is intentional that they are applied in ticks.

migrated

This is probably intended. I would label this as a feature and not a bug. Since these effects are instant, it probably makes sense that they go by the tick. Still true in 1.8

migrated

Confirmed in 15w36d

The following command does as expected. It states the effect is applied for 20 seconds and applies the effect for 20 seconds
/effect @a night_vision 20 0

The following command does not do as expected. It states that the command is applied for 20 seconds but actually applies the effect for 20 ticks (1 second)
/effect @a saturation 20 0

The effects should be consistent using either ticks or seconds preferably ticks because that allows more fine control but the actual bug here is that it states it is applying the effect for n seconds but is actually applying the effect for n ticks for certain potion effects

migrated

Confirmed for 15w43b.

migrated

Fixed for Saturation, so why not the others?

migrated
[media]

This problem still exists in 1.13 and 1.13.1. The tool tip says <Seconds> but it is actually in ticks.

migrated

IMO this should be for all effects.

migrated

Agreed. More specifically I think /effect should use the duration system used by /time and the like.

migrated

My suggested fix is to change the field from seconds to duration and adding a "t" or "s" after the inputted value determines whether its in ticks or seconds.

NeunEinser

Not sure when exactly that was re-introduced, but it does apply to saturation again in at least 1.16.5 and 1.18.1

migrated

Um, what does the "and custom potions" refer to in the title?
Also, 100% sure it was never changed for saturation; it always applied in ticks.

muzikbike

Can confirm in 22w12a

migrated

Given the changes to the /weather and /title times commands in 23w03a, perhaps this should be reflected in the title of this bug?

migrated

That would make this requesting a change, rather than reporting a bug. This issue is about the value being treated differently based on the effect type, not the lack of t, s and d suffix usage.

Former user

relates to MC-139527, which needs to be updated.

migrated

Still affects modern minecraft up through 1.19.4-pre1.

effect give @s minecraft:saturation 1200 0 true

Will only give 60 seconds of saturation.

migrated

(Unassigned)

Confirmed

Platform

Low

Commands

Minecraft 1.6.1, Minecraft 1.6.2, Minecraft 1.7.4, Minecraft 14w02c, Minecraft 14w03b, ..., 1.20.5 Pre-Release 3, 1.20.6, 1.21 Pre-Release 4, 1.21.1, 24w35a

Retrieved