I want to give players a temporary boost to harvesting speed or damage dealt. For example /rageMode would give 2x damage and 0.5 block break time for time. For this I assume I should intercept InteractBlockEvent and InteractEntityEvent and if the player has the buff alter some something. What I cannot seem to figure out is what I need to alter or how to access it. Please let me know what I should be looking for.
I know in Forge there’s literally an event that does exactly that (
PlayerEvent.BreakSpeed), but there’s no such event in sponge.
What you could do is play around with potion effects,
PotionEffectTypes.MINING_FATIGUE could be applied to slow down the speed and
PotionEffectTypes.HASTE can be used to speed it up.
you could apply the effect when the player hits the block (
InteractBlockEvent.Primary) with a short duration and remove the effect on