When the same potion is consumed or applied again on a creature (including yourself), the effect of the potion will be stacked in level, rather than simply refreshing the duration as in vanilla.
Example: When you have the Strength I effect, drinking another Strength Potion will directly upgrade to Strength II, and another drink will upgrade to Strength III, and so on. The accumulated effects are stronger, but will not exceed the set maximum level cap.
This is very suitable for weapons that have an attack with a potion effect.Moreover, players can easily customize which effects can be stacked and which effects can only be stacked up to a maximum number of layers.
#stackable_effects = ["effect id,max stack,cooldown,duration condition"]
·#effect id: Potion effect ID
·#max stack: Maximum stack level (cap) for the potion effect
·#cooldown: Time in ticks that must elapse before the effect can be stacked again. Set to 0 for no cooldown.
·#duration condition: Time in ticks. The newly applied potion effect will only be stacked if its duration is greater than or equal to this value. Set to 0 to allow stacking regardless of duration. Set to 200, for example, and the new effect must have a duration of at least 10 seconds (200 ticks) to be eligible for stacking.
-------------------------------------------------------------------------------------------
stackable_effects = ["minecraft:strength,5,20,200"]
#This configuration means that repeated strength effects with a duration greater than 10 seconds can be stacked up to level V and require 1 second of cooling before they can be stacked again.
/stackableeffect get <effectid> <maxstack> <cooldown> <durationcondition>
/stackableeffect all
·No one has asked me any questions yet😜