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

onTap

Comments in 'Plugin Development' started by Kripak, Nov 5, 2015.

  1. Kripak
    Offline

    Kripak New Member

    Joined:
    Jul 17, 2015
    Posts:
    45
    Minecraft User:
    Kripak
    With tap on a certain block is not the subject of a certain (not coal for e.g) will be written in chat "tap whith the coal." How to do it ?
  2. Svile
    Offline

    Svile Active Member

    Joined:
    Mar 30, 2015
    Posts:
    239
    Minecraft User:
    svile
    you can use PlayerInteractEvent.
  3. PocketKiller
    Offline

    PocketKiller Notable Member

    Joined:
    Jul 20, 2015
    Posts:
    741
    Learn PHP ._.
    PHP:
    public function onTap(PlayerInteractEvent $event){
    if(!
    $event->getBlock() === Block::/*block*/){
    //CODE
    }
    }
  4. Kripak
    Offline

    Kripak New Member

    Joined:
    Jul 17, 2015
    Posts:
    45
    Minecraft User:
    Kripak
    And here php? So I just do not understand. It is as though a PM API is .-. And about the PM API then ask apparently cancelled ?
  5. PocketKiller
    Offline

    PocketKiller Notable Member

    Joined:
    Jul 20, 2015
    Posts:
    741
    no, i know you can check if it is, but if you know PHP You would write ! (not equal to) it's PHP.
  6. Kripak
    Offline

    Kripak New Member

    Joined:
    Jul 17, 2015
    Posts:
    45
    Minecraft User:
    Kripak
    I tried to do it, but it did not and that's why I asked here ... I'm not a great programmer and a novice.
  7. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    You're comparing object with an integer wont work always will return false!
    fix
    PHP:
    if(!$event->getBlock->getId() === Block::/* block *.)
  8. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Learn PHP yourself.

    Why don't you simply use !== ?
    Gamecrafter likes this.

Share This Page

Advertisement