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

How to remove a block & get tap cords

Comments in 'Plugin Development' started by xFlare, Mar 16, 2015.

  1. xFlare
    Offline

    xFlare Active Member Plugin Developer

    Joined:
    Sep 28, 2014
    Posts:
    199
    Plugins:
    1
    Minecraft User:
    xFlare
    First question:
    - How can I remove a block? Remove block $x $y $z

    - How can I get the cords when a player taps a block?

    //player interact event
    // get x of taped block
    // get y of taped block
    // get z of taped block
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    You can't remove a block. You can only set it to air.
    $event->getBlock() is a Block (also a Position and a Vector3) representing the block clicked. Use it like a Vector3.
  3. xFlare
    Offline

    xFlare Active Member Plugin Developer

    Joined:
    Sep 28, 2014
    Posts:
    199
    Plugins:
    1
    Minecraft User:
    xFlare
    Can I also do this:

    $block = $event->getBlock();
    if($block instancof Snow){
    //Stop event
  4. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,707
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Yeah. Make sure to use the correct Snow class though.
    PEMapModder and xFlare like this.

Share This Page

Advertisement