Solved Detect if a player is breaking a block

Discussion in 'Spigot Plugin Development' started by Lyphiard, Aug 27, 2015.

  1. Is it possible to detect if a player is currently breaking a block or holding left click?

    I'm currently trying to make a bedrock breaker plugin which will animate the breaking/cracking effect. The closest I've come so far is by checking if the player has looked away from the block, but that's about it.
     
  2. PlayerInteractEvent
     
  3. PlayerInteractEvent will only register the left click once. I need to be continuously checking if the player is holding left click.
     
  4. Interact event start, block break event start.. Add them to a list on interact remove them on blockbreak...
     
  5. BlockBreakEvent will never be called since this is bedrock
     
  6. xD Then there is no way to know..
     
  7. Not necessarily: If you're making a bedrock breaking plugin it is your plugin that will most likely be calling break(). If you're calling break() then you can just add some core before or after the call.
     
  8. To know when the player is digging.. yeah that's impossible if the block never breaks. The client is told never to break a bedrock in survival game modes.
     
  9. After doing some further research, I found out about PacketPlayInBlockDig. You can then use EnumPlayerDigType to determine if the player has stopped digging.
     
    • Like Like x 2