mojira.dev
MC-297614

Area effect clouds with duration greater than or equal to 2147483628 disappear after a tick

In previous versions you could summon an area effect cloud that would not disappear for a very long time with:

/summon area_effect_cloud ~ ~ ~ {CustomNameVisible:1b,Duration:2147483647}

Where 2147483647is the max integer. However since 1.21.5, these AEC’s disappear after a tick.

It seems like this happens whenever Duration is 2147483628 or higher. As soon as you set it to 2147483627, the AEC stays in the world with the set Duration and its Age starts counting upwards.

Code analysis

This is happening because AreaEffectCloud#serverTick uses the code this.tickCount >= this.waitTime + this.duration where this.waitTime (WaitTime in NBT) defaults to 20 and causes this comparison to overflow.

Notice that when setting WaitTime to 0, the AEC stays in the world:

/summon area_effect_cloud ~ ~ ~ {CustomNameVisible:1b,Duration:2147483647,WaitTime:0}

Comments 0

No comments.

Misode

Panda4994

Confirmed

Platform

Normal

Commands

1.21.5

25w20a

Retrieved