Solved Instant Break Sponge

Discussion in 'Plugin Help/Development/Requests' started by 808sFinest, Mar 24, 2016.

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

    808sFinest

    Last edited: Mar 27, 2016
  2. Offline

    Kilorbine

    Does it catch the left click?
    Try to add a
    e.setCanceled(true);
    At the end of playerInteract method
     
  3. Offline

    808sFinest

    @Kilorbine doesn't work.. hmmm.... sorry im a noob and am learning more atm.
     
  4. Online

    timtower Moderator Moderator

    808sFinest and Kilorbine like this.
  5. Offline

    808sFinest

    @timtower yay thank you, it works but do you know how to make it drop the item?
     
  6. Online

    timtower Moderator Moderator

    @808sFinest world.dropItemNaturally or something along those lines.
     
    808sFinest likes this.
  7. Offline

    808sFinest

    @timtower okay thank you very much :D i just had to replace b.setType(Material.AIR); with
    b.breakNaturally();
     
  8. Offline

    808sFinest

  9. Online

    timtower Moderator Moderator

    @808sFinest Throw a block break event, check if it gets cancelled.
     
  10. Offline

    drew6017

    Use BlockBreakEvent, not PlayerInteractEvent. If you do, this will literally take 10 seconds.
     
  11. Offline

    808sFinest

    @drew6017 okay but now it doesn't break the sponge instantly
     
  12. Offline

    mcdorli

    You need 2 different events, both the playerinteractevent for insta-break, and blockbreak for protection
     
  13. Offline

    808sFinest

  14. Offline

    drew6017

    ^^

    I did not know you wanted it to instant break. For that you would use the player interact even and catch if a player clicked a block. Again, it will take like 10 seconds. I do not look at titles. Please put all of what you want in the description next time.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
Thread Status:
Not open for further replies.

Share This Page