Feel dumb to post here again in less then a week but... I´m trying to make an ablity on my weapon that adds an slowness effect when the other 3 effects are gone Is there any way to do that? also if it helps here is the code of my weapon class
There are several ways to approach this, with different downsides. One way to achieve what you want would be to listen to the PotionExpiryEvent, and check if the player is holding the FOREST_STRIKER item, then apply the slowness. The obvious downside of this is that you could avoid the slowness by unequipping the item.
Another approach would be to create and register a new custom effect, that you also apply in your item onItemRightClick(). You could then code the effect to apply slowness when it is about to expire.
A third approach would be to attach a capability with a timer to the player, which you would set in the onItemRightClick(), and then when the timer reaches 0, apply slowness.
Feel dumb to post here again in less then a week but... I´m trying to make an ablity on my weapon that adds an slowness effect when the other 3 effects are gone Is there any way to do that? also if it helps here is the code of my weapon class
There are several ways to approach this, with different downsides. One way to achieve what you want would be to listen to the PotionExpiryEvent, and check if the player is holding the FOREST_STRIKER item, then apply the slowness. The obvious downside of this is that you could avoid the slowness by unequipping the item.
Another approach would be to create and register a new custom effect, that you also apply in your item onItemRightClick(). You could then code the effect to apply slowness when it is about to expire.
A third approach would be to attach a capability with a timer to the player, which you would set in the onItemRightClick(), and then when the timer reaches 0, apply slowness.