Help with Entity

Discussion in 'Plugin Development' started by CactusComboPvP, Mar 1, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    CactusComboPvP

    So, i'm trying to control an enderdragon and it sort of works.
    I have used this as my e() class to make it face where i am facing:

    Code:
    @Override
        public void e(float one, float two) {
            this.lastYaw = this.yaw = this.passenger.yaw;
            this.pitch = this.passenger.pitch * 0.5F;
           
            this.b(this.yaw, this.pitch);
            this.aO = this.aM = this.yaw;
            super.e(one, two);
            return;
        }
    and I'm using this to fly him

    Code:
    @EventHandler
          public void onPlayerMove(PlayerMoveEvent e) {
            Player p = e.getPlayer();
            double defaultspeed = 1.0;
            double d = defaultspeed;
            if (p.getVehicle() != null)
            {
                Entity v = p.getVehicle();
                Vector f = p.getEyeLocation().getDirection().multiply(d);
                v.setVelocity(f);
                v.teleport(
                  new Location(v.getWorld(), v.getLocation().getX(), v
                  .getLocation().getY(), v.getLocation().getZ(), p
                  .getEyeLocation().getPitch(), p.getEyeLocation().getYaw()));
                p.setFallDistance(0.0F);
                v.setFallDistance(0.0F);
            }
          }
    
    It goes where I want him to, but he doesn't face that way. It works for any other mob than this.
    Is there any way I can make him face the way i'm looking?

    Please don't link me to this http://bukkit.org/threads/tutorial-1-7-5-wasd-entity-riding.163019/

    I've already tried it. Any help?
     
  2. Offline

    Zombie_Striker

  3. Offline

    CactusComboPvP

Thread Status:
Not open for further replies.

Share This Page