Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PlayerInteractEvent before PlayerBlockBreakEvent

Comments in 'Plugin Development' started by laccolite, Dec 30, 2014.

  1. laccolite
    Offline

    laccolite New Member

    Joined:
    Mar 1, 2014
    Posts:
    22
    When a player breaks a block PlayerInteractEvent goes first and then PlayerBlockBreakEvent. How to deal with it?
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    How do you want to "deal with it"? Just accept it.
  3. laccolite
    Offline

    laccolite New Member

    Joined:
    Mar 1, 2014
    Posts:
    22
    I want to separate those two events.
  4. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,167
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    just create functions on both events. it will just do the rest.
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Then don't listen to one of these events.
  6. laccolite
    Offline

    laccolite New Member

    Joined:
    Mar 1, 2014
    Posts:
    22
    How? Both events are needed.
  7. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Why? They are the same, except BlockBreakEvent is only for block breaking. You can get all information you need in PlayerInteractEvent.
  8. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    PlayerInteractevent return the information when the block is touched.

    BlockBreakEvent return the same and more information when the block is breaked.

Share This Page

Advertisement