#[1.20.6] - How to get potion length from itemstack ?

1 messages · Page 1 of 1 (latest)

still dome
#

Hello, i'm trying to get potion's length. Does anyone have an idea ?

queen shard
#

Do you mean the duration of the potion or something else

#

You may need to use the method getStatueEffect (...). getDuration in PlayerEntity if you want to get the duration of the potion

still dome
#

I mean a potion in inventory, before using it, detecting which duration the potion has. Is it possible ? because i found nothing on docs

queen shard
queen shard
#

oh, There seems to be such a method in StatueEffectUtil and PotionUtil that you can try it out

#

like this,I used 1min30 potion to obtain 1800tick