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

break & place blocks

Comments in 'Plugin Development' started by imJayL, Mar 4, 2016.

  1. imJayL
    Offline

    imJayL Active Member

    Joined:
    Aug 5, 2015
    Posts:
    52
    Minecraft User:
    PHC_imJayL
    What is the code for allowing player to break & place blocks
  2. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    PHP:
    $event->setCancelled(false);
    While $event can be BlockBreakEvent and/or BlockPlaceEvent
    PocketKiller likes this.
  3. imJayL
    Offline

    imJayL Active Member

    Joined:
    Aug 5, 2015
    Posts:
    52
    Minecraft User:
    PHC_imJayL
    Even if the world is protected ??
  4. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    How you mean that? Do you protect your world using a plugin?
  5. imJayL
    Offline

    imJayL Active Member

    Joined:
    Aug 5, 2015
    Posts:
    52
    Minecraft User:
    PHC_imJayL
    Yes
  6. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    Okay :p And which one? Or do you have an own one?
  7. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Set event handler priority to HIGH

    PHP:
    /**
     * @priority HIGH
     * @ignoreCancelled false
     */
    public function e_break(BlockBreakEvent $event){
      
    $event->setCancelled(false);
    }
  8. imJayL
    Offline

    imJayL Active Member

    Joined:
    Aug 5, 2015
    Posts:
    52
    Minecraft User:
    PHC_imJayL
    Ive Fixed it :) .. Thanks a lot

Share This Page

Advertisement