1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Super Leap

Discussion in 'Development' started by Jonas, Mar 7, 2017.

  1. Jonas

    Jonas Baby Zombie

    Messages:
    192
    How can i make a super leap like Mineplex ?
     
  2. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
    PHP:
    $player->setMotion(new Vector3(0,1,0));
     
  3. Jonas

    Jonas Baby Zombie

    Messages:
    192
    Can you give me an example?
     
  4. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
    How is the post above not an example? What example do you want?
     
  5. Jonas

    Jonas Baby Zombie

    Messages:
    192
    Can you give me an example were do you make a super leap with the playerinteractevent?
     
  6. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    PHP:
    public function onInteract(PlayerInteractEvent $event){
        
    $blockId 1;
        if(
    $event->getBlock()->getId() === $blockId){
            
    //Do what wolf just said.
        
    }
    }
     
  7. Jonas

    Jonas Baby Zombie

    Messages:
    192
    This Code dosn't work and it comes no errors
    PHP:
    <?php

    namespace Leap;

    use 
    pocketmine\event\Listener;
    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\event\player\PlayerInteractEvent;
    use 
    pocketmine\math\Vector3;
    use 
    pocketmine\Server;

    class 
    Main extends PluginBase implements Listener {
        
        public function 
    onEnable() {
            
    $this->getServer()->getPluginManager()->registerEvents($this$this);
        }
        
        public function 
    onInteract(PlayerInteractEvent $event) {
             if(
    $event->getItem()->getID() === 276) {
             
    $player->setMotion(new Vector3(030));
             }
         }
    }
     
  8. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    • getID() doesn't exist. It must be getId()
    • If you are using getItem(), then you must tap any block with item 276 in your hand.
    • You didn't define $player.
     
  9. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    Upper-/lowercase doesn't matter with functions :p
     
    HimbeersaftLP and Muqsit like this.
  10. Jonas

    Jonas Baby Zombie

    Messages:
    192
  11. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    :facepalm:
     
  12. xBeastMode

    xBeastMode Shog Chips

    Messages:
    0
    I may get hate for this, please go learn PHP.
     
  13. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Oh crap, didn't know that :p
     
  14. Jonas

    Jonas Baby Zombie

    Messages:
    192
    Im lerning PHP
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.