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

Solved DATA_FLAG_ACTION && LEFT_CLICK_AIR

Comments in 'Plugin Development' started by Kvetinac97, Jul 19, 2015.

  1. Kvetinac97
    Offline

    Kvetinac97 Active Member Plugin Developer

    Joined:
    Nov 17, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    Kvetinac97
    Hi.

    In PlayerInteractEvent, I use:
    PHP:
    if ($ev->getAction() === PlayerInteractEvent::LEFT_CLICK_AIR){
    $ev->getPlayer()->sendMessage(TextFormat::GRAY."o_O You tapped air");
    }
    But I'm tapping screen (no block, so i'm "tapping" air) and nothing happens.

    I'm also trying to use DataFlags. I know that Sneaking works, Riding not. But what does the DataFlag Action? Does it work?
  2. SpiderPig
    Offline

    SpiderPig Active Member

    Joined:
    Sep 21, 2013
    Posts:
    128
    Minecraft User:
    SpiderPig
    PHP:
    if ($ev->getAction() === LEFT_CLICK_AIR){
    $ev->getPlayer()->sendMessage(TextFormat::GRAY."o_O You tapped air");
    }
    That's the correct code also riding doesn't use the DataFlags.
  3. ahoj_truhliku
    Offline

    ahoj_truhliku Banned

    Joined:
    Jul 9, 2015
    Posts:
    89
    Minecraft User:
    Creeperface001
    DATA_FLAG_RIDING is not implented
  4. Kvetinac97
    Offline

    Kvetinac97 Active Member Plugin Developer

    Joined:
    Nov 17, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    Kvetinac97
    And: what does the DATA_FLAG_ACTION do?
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    LEFT_CLICK_AIR is fired when player starts breaking a block.
  6. Kvetinac97
    Offline

    Kvetinac97 Active Member Plugin Developer

    Joined:
    Nov 17, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    Kvetinac97
    So, why it's called LEFT_CLICK_AIR? I thought that LEFT_CLICK_BLOCK/RIGHT_CLICK_BLOCK is fired when player starts breaking block/tap block
  7. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Because Shoghi likes it xD
    Both are fired.

Share This Page

Advertisement