Block digging speed

Discussion in 'Plugin Development' started by dfgpo3, Aug 18, 2021.

Thread Status:
Not open for further replies.
  1. Offline

    dfgpo3

    Greetings, I recently wondered how it is possible to set the player to dig all the blocks at a certain speed? At first I thought to use the effects to slow down the digging, but unfortunately I can't set the speed to exactly 5s(for example) through it.

    I would like to listen to the suggestions of other developers because I don't fully know the bukkit api yet.
     
  2. Offline

    Tim_M

    Listen when the player starts mining a block (PlayerInteractEvent I believe), create a new BukkitRunnable with a set delay in ticks, then break the block and drop the item the block woul have dropped. Also give player infinite mining fatigue so that they can't break the block normally (if the delay you want happens to be slower than the actual time it takes to break the block).
     
  3. Offline

    dfgpo3

    Hmmm,it's good idea ;p
    Thx
     
  4. Offline

    byteful

    You could change the strength of the block through NMS or Reflections.
     
  5. Offline

    Tim_M

    True, but I wasn't sure if it would be possible or easy.
     
  6. Offline

    dfgpo3

    Okay, I'll try to make your idea first. Thank you for the offer.
     
  7. Offline

    dfgpo3

    Hey, I had some free time and I tried to make your way, but first I decided to check if I can change the block strength at all. Here's what I got:
    Could you help me with this if you know what the problem is ?
     
Thread Status:
Not open for further replies.

Share This Page