Increase MOB SPEED in WATER?

Discussion in 'Plugin Development' started by Shay Williams, Mar 24, 2013.

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

    Shay Williams

    Hey Bukkit,

    As the title suggests, I'm trying to mess around with NMS / CB code to make certain monsters such as skeletons move faster in water than in vanilla. I know you can increase their speed on land by modifying their pathfinder goals, but I've had little to no luck trying to apply these same changes while they're swimming.

    Any advice is greatly appreciated.
     
  2. Offline

    chasechocolate

    Maybe just use a scheduler and check if the block at the entity's location is water or stationary water.
     
  3. Offline

    Shay Williams

    Ok... But how does that solve the problem? That's a way to detect when they're in water, but what to do about it once the system recognizes that?
     
  4. Offline

    Scyntrus

    The NMS class Entity has a protected variable called inWater which can be accessed with the function G(). So no need to check blocks. As for the mob speed thing, I'm still trying to figure it out.
     
  5. Offline

    Shay Williams

    Any luck on this?
     
  6. Offline

    Rprrr

    Pseudo-code:

    Code:
    if (mob is in water){
    PathFindGoalThing pathFindGoalThing = mob.getPathFindGoalThing;
    mob.setPathFindGoalThing(pathFindGoalThing, speed);
    }
     
  7. Offline

    Shay Williams

    Even if I set the speed to ridiculously high numbers, they run around like lightning bolts on land but like snails once they hit the water.
     
Thread Status:
Not open for further replies.

Share This Page