How do you make a boat go fast on land?

Discussion in 'Plugin Development' started by FoxinatorDev, Sep 4, 2017.

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

    FoxinatorDev

    I'm pretty much a noob at bukkit coding. If anyone knows how to make a boat go faster on land or how to make a WASD detector, please tell me.
     
  2. Offline

    MasterDoctor

    I've been playing around and then I learnt that you can just cast the Player's vehicle to a boat (of course, after checking if the vehicle is in fact a boat) and set boat.workOnLand(true); and then it works just like it does in the water. Obviously, if you're trying to get it to work as a car, it may not be ideal and may require some fiddling.

    When I was playing around, I just found it convenient to put it in VehicleEnterEvent because then it applies for all boats.

    Here's my implementation:

    Code:
    @EventHandler
        public void onPlayerEnterVehicle(VehicleEnterEvent event){
            if(event.getVehicle().getType().equals(EntityType.BOAT)){
                Boat boat = (Boat) event.getVehicle();
                boat.setWorkOnLand(true);
            }
        }
    
     
  3. Please note this method is deprecated as of the 1.12 docs due to the complex system of the boat.
     
  4. Offline

    TheWolfBadger

    Maybe setting the vector would be a good idea to go about this? It would only using the direction they're looking however, that's the downfall of it...
     
  5. Offline

    FoxinatorDev

    How would I do that?..
     
  6. Offline

    MrGriefer_

    Listen for PlayerMoveEvent and check if the player is inside a boat and then simply multiply its velocity. Not sure if that would work :p
     
Thread Status:
Not open for further replies.

Share This Page