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

Jump

Comments in 'Plugin Development' started by Kripak, Oct 22, 2015.

  1. Kripak
    Offline

    Kripak New Member

    Joined:
    Jul 17, 2015
    Posts:
    45
    Minecraft User:
    Kripak
    Which event jump ?
  2. Artide
    Offline

    Artide Active Member

    Joined:
    Apr 20, 2015
    Posts:
    214
    Minecraft User:
    Artide5
    What? Do you mean what event for when players toggle jump?
  3. Svile
    Offline

    Svile Active Member

    Joined:
    Mar 30, 2015
    Posts:
    239
    Minecraft User:
    svile
    when a player jump PlayerMoveEvent is called
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    PocketMine does not know whether a player is jumping. The client only sends the position the player is currently at and does not send things like what buttons (e.g. front, back,, jump) the player clicked.
  5. iDirtPlayzMC
    Offline

    iDirtPlayzMC Active Member

    Joined:
    Apr 10, 2015
    Posts:
    264
    Minecraft User:
    iZenith_xPr
    In the future will these features be add?
  6. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Probably no, but you can make calculation, wich would probably be not efficient.
  7. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    Not sure if this will work as i just thought of it off the top of my head, but try:
    PHP:
    public function onMove(PlayerMoveEvent $event) {             
            
    $player $event->getPlayer();
            
    $block $event->getPlayer()->getLevel()->getBlock($event->getPlayer()->floor()->subtract(01));
           
            if(
    $event->getTo()->getY() > $event->getFrom()->getY() && $block->getId() == 0) { // If player jumps
                // Your code
            
    }
  8. MCPEPIG
    Offline

    MCPEPIG Notable Member

    Joined:
    Jun 22, 2014
    Posts:
    349
    Minecraft User:
    MCPEPIG
    What if the player's flying :p
  9. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    Simple. Just check if $player->getGamemode() == 0
  10. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    What if the player is swimming, or on a ladder like this?
    And what if he is just flying because of a knockback or am explosion?
  11. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    Well thats where it gets tricky. I'm sure someone could figure out a workaround though.
  12. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    And this tricky part is why I don't think anyone will really spend the time to do it accurately :p
    Legoboy0215 likes this.
  13. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    xD i had the same question. Why cant the user learn to use the search bar?
  14. MCPEPIG
    Offline

    MCPEPIG Notable Member

    Joined:
    Jun 22, 2014
    Posts:
    349
    Minecraft User:
    MCPEPIG
    What if the player can fly cause of /fly ($player->setAllowFlight()) :p
  15. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    You know you can check that right?
    PHP:
    If($player->getAllowFlight() == true)
  16. MCPEPIG
    Offline

    MCPEPIG Notable Member

    Joined:
    Jun 22, 2014
    Posts:
    349
    Minecraft User:
    MCPEPIG
    Yeah :p
  17. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Actually, == true is always redundant. You can simply do if($player->getAllowFlight()) :)
    jojoe77777, MCPEPIG and Hotshot_9930 like this.
  18. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    i think everytime when player go up and is not on ladder / (something in jungle) / water / lava / slabs / stairs it is jump
  19. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Why we need stairs? Because it isn't jump, and player has less hunger consumed by walking on stairs instead of jumping up whole blocks. (Minecraft knowledge)
    jojoe77777 likes this.
  20. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    no meant if player is on stairs etc it is not jump xD

Share This Page

Advertisement