Velocity of mobs (distance and speed of movement)

Discussion in 'Plugin Development' started by Phiwa, Nov 19, 2011.

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

    Phiwa

    In my current version of DragonTravel I am able to summon a pig (testing with pigs) which then travels to a location I set ealier (if the way is flat), BUT:

    The velocity handles the direction, the distance and the speed.

    The problem now is that the pig EITHER runs half of the way and then stops OR it runs the complete distance, but has a veeery high speed (depends on how I set the multiplier of the vector).

    The reason for that is that the distance as well as the speed depends on the velocity-Vector's length.

    The longer the vector, the longer the travel.
    The longer the vector, the faster the travel.

    Does anyone have an idea how to solve this problem?


    My first idea was to divide the vector up into several smaller ones and let the dragon travel along them, but I don't have an idea how to do that...
     
  2. Offline

    thehutch

    could you use a repeated task to keep setting the vector of the player? and can you create a speed limiter say if player moves x blocks in y time then set slow them down and vicer versa if they go too slow? Idk if possible but if yes then thats the way I would think of
     
  3. Offline

    Phiwa

    What I thought of was to somehow recalculate the vector to the target every 20 (?) blocks, but don't know how to do that.
    The problem about the dragons is that they do not act the way pigs do.
    Pigs simply stop and walk around for some blocks, but dragons fly about 200 blocks away after the distance set by the vector has been "finished"...

    Your idea of a speed limiter is what I thought of as well, but I have no idea how to realize that in bukkit.
    I only know how to kick the player after he moved too fast, not how to stop him before really doing so. ;)
     
Thread Status:
Not open for further replies.

Share This Page