Velocity for a unnormal spawned fishing hook

Discussion in 'Plugin Development' started by CorePvP, Jan 15, 2014.

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

    CorePvP

    Hey,

    i tried to spawn a fishing hook without holding a fishing rod and i acutally worked.

    I used : world.addEntity(f);
    and then f.setLocation(x, y, z,..)

    but then the fishing hook just stucks by the location where it was spawn.

    I want to make it to have the same velocity as a normal fishing hook.multiply(2)
     
  2. Offline

    Doamax

    How about defining it as its spawned, f = world.spawnEntity(...), then set the velocity. Just a guess.
     
  3. Offline

    xTrollxDudex

    CorePvP
    Are you using the NMS EntityFishingHook class? If so, here is how Bukkit does it:
    PHP:
        public void setVelocity(Vector vel) {
            
    entity.motX vel.getX();
            
    entity.motY vel.getY();
            
    entity.motZ vel.getZ();
            
    entity.velocityChanged true;
        }
    Just replace entity with f.
     
  4. Offline

    Garris0n

    hook.getBukkitEntity().setVelocity()
     
Thread Status:
Not open for further replies.

Share This Page