Solved BlockBreakEvent

Discussion in 'Spigot Help' started by 01v, Dec 12, 2018.

  1. 01v

    01v

    Hi. I am making a plugin which gives you haste when a player is about to break a block(with PlayerInteract), so when the player hits the block, and started the break animation, he receives haste. Then i remove the potion effect onBreakevent.

    The problem is, that a player can just hit the block, or cancel the breaking animation, and keep the potion effect. How can I check if the player did not break the block?

    I know i can just set the potion time, but since the time to break the block varies from tools or enchants i dont want to do it that way.

    Any ideas how I can do this?
     
  2. md_5

    Administrator Developer

  3. 01v

    01v

    Thank you, will check it out