.setPassenger not working properly.

Discussion in 'Spigot Plugin Development' started by xlis1, May 2, 2017.

  1. im trying to make it so when you throw an egg you ride it, thats it, yet when i throw the egg i dont ride it, but when it lands my player teleports to the side one block as if i dismounted a minecart.


    Code:
    Code (Text):
    @EventHandler
        public void nochick(PlayerEggThrowEvent event) {
            event.getEgg().setPassenger(event.getPlayer());
            event.setHatching(false);
        }
     
  2. Can you ride an egg?
    I would do it with enderpearls
     
    • Agree Agree x 1
  3. Do you get any console errors?
     
  4. Why shouldn't people ride an egg? Its still a Projectile and also a basic Item.class ( Entity )
    EnderPearls are still the same only the type is different.
     
  5. no i did not
     
  6. You could change the event to ProjectileLaunchEvent and apply the passenger there when the launched projectile is an egg.
    Note: not tested and might doesn't do any changes.