Riding an Egg - But, HOW?

Discussion in 'Plugin Development' started by deleted_91027365, Mar 16, 2015.

Thread Status:
Not open for further replies.
  1. Hey,
    I want to set a passenger on a flying Egg.
    My Code:
    PHP:
    @EventHandler
        
    public void onAnyDrop(PlayerEggThrowEvent e){
            if(
    e.getEgg() instanceof Egg) {
                final 
    Egg egg e.getEgg();
                final 
    Player shooter = (Playeregg.getShooter();
           
               
           
                
    Entity entity e.getPlayer();
           
    egg.setPassenger(shooter);
               
               
           
            }
            }    
    But it only sets the Passenger on the moment, the Egg HIts the ground.
    Is it possible to ride the Egg on fly?
     
  2. egg throw event is only fired when the egg hits the ground
     
  3. Offline

    CraftCreeper6

    Cycryl and Neonix like this.
  4. Offline

    Cycryl

    if there shooter gets hit by the entity when riding it you may need to do CraftWorld.removeEntity(arrow)
    or something to cancel its collision
     
  5. Offline

    VortexGmer

    To cancel the event you CANNOT remove the entitybecause then the riding would be cancelled, try making another projectile with the same velocity of the previous projectile:D
     
Thread Status:
Not open for further replies.

Share This Page