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

Interacting with an air block.

Comments in 'Plugin Development' started by SpiderPig, Dec 12, 2014.

  1. SpiderPig
    Offline

    SpiderPig Active Member

    Joined:
    Sep 21, 2013
    Posts:
    128
    Minecraft User:
    SpiderPig
    Hi,

    How would you interact with an air block?

    Because I have a clientside entity that i would like the server to interact with so how would Interact with the airblock that is there according to the server?
  2. SpiderPig
    Offline

    SpiderPig Active Member

    Joined:
    Sep 21, 2013
    Posts:
    128
    Minecraft User:
    SpiderPig
    I basically send out the entity from the server but I cannot interact with it.
  3. DA_Swagnemite
    Offline

    DA_Swagnemite Notable Member Plugin Developer

    Joined:
    Nov 17, 2013
    Posts:
    388
    Plugins:
    7
    Minecraft User:
    DA_SWAGNEMITE
    I dont think PocketMine does anything if a player interacts with an air block because its simply a block that doesnt exist
  4. SpiderPig
    Offline

    SpiderPig Active Member

    Joined:
    Sep 21, 2013
    Posts:
    128
    Minecraft User:
    SpiderPig
  5. SpiderPig
    Offline

    SpiderPig Active Member

    Joined:
    Sep 21, 2013
    Posts:
    128
    Minecraft User:
    SpiderPig
    Maybe air??
  6. DA_Swagnemite
    Offline

    DA_Swagnemite Notable Member Plugin Developer

    Joined:
    Nov 17, 2013
    Posts:
    388
    Plugins:
    7
    Minecraft User:
    DA_SWAGNEMITE
    I was thinking the same thing if you could do this kind of task but its doubtful that it does because it doesnt exist. Try this code:
    PHP:
    public function onPlayerInteractEvent(PlayerInteractEvent $event) {
        if(
    $event->getBlock()->getId() == 0) {
            
    //Do Something
        
    }
    }
    If that doesnt work then PocketMine does nothing when a client interacts with air and there is nothing you can do..
  7. SpiderPig
    Offline

    SpiderPig Active Member

    Joined:
    Sep 21, 2013
    Posts:
    128
    Minecraft User:
    SpiderPig
    Ok well I'll try!
  8. DA_Swagnemite
    Offline

    DA_Swagnemite Notable Member Plugin Developer

    Joined:
    Nov 17, 2013
    Posts:
    388
    Plugins:
    7
    Minecraft User:
    DA_SWAGNEMITE
    There also may be some kind of workaround for what you would like to do too. If that code does nothing at all, tell me what it is your trying to do in more detail and ill see if I can figure out a workaround.
  9. SpiderPig
    Offline

    SpiderPig Active Member

    Joined:
    Sep 21, 2013
    Posts:
    128
    Minecraft User:
    SpiderPig
    Otherwise how would I send packets to the PM server?
  10. SpiderPig
    Offline

    SpiderPig Active Member

    Joined:
    Sep 21, 2013
    Posts:
    128
    Minecraft User:
    SpiderPig
    That code doesn't work.... That's why I asked for ^^^
  11. DA_Swagnemite
    Offline

    DA_Swagnemite Notable Member Plugin Developer

    Joined:
    Nov 17, 2013
    Posts:
    388
    Plugins:
    7
    Minecraft User:
    DA_SWAGNEMITE
    For a workaround I'd need to know exactly what your trying to do. In but sure how packet sending works though..
  12. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    What do you want to do? Do you want to imitate the player sending a data packet of touching an air block, or what?
  13. SpiderPig
    Offline

    SpiderPig Active Member

    Joined:
    Sep 21, 2013
    Posts:
    128
    Minecraft User:
    SpiderPig

    I want to Detect when I player interacts with a specific Air block.
  14. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    But the player won't interact with an air block.
  15. SpiderPig
    Offline

    SpiderPig Active Member

    Joined:
    Sep 21, 2013
    Posts:
    128
    Minecraft User:
    SpiderPig
    Well how to do?
  16. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    What do you want? How can a player touch an air block? If he can, he can touch nothing else.
    rinkuno likes this.

Share This Page

Advertisement