Interface MountController

All Known Implementing Classes:
AbstractMountController, FlyingMountController, FlyingMountController_v16, FlyingMountForcedController, WalkingMountController, WalkingMountForcedController

public interface MountController
Interface used by MoveController to allow special passenger behavior, such as controlling movement of the model.
While not strictly necessary, we recommend registering the controller with MountControllerRegistry.register(String, Supplier) so your custom controller can be accessed by other plugins with a string ID.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Data class containing the movement control sent by a player.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.entity.Entity
    Get the rider.
    Get the movement input.
     
    void
    setEntity(org.bukkit.entity.Entity entity)
    Set the rider using this controller.
    void
    Record the movement input sent by the rider.
    This method is called whenever a new movement control packet is received.
    void
     
    void
    Update the look direction of the vehicle.
    This method is called each movement tick of the vehicle, and is only called when the controller is used by a driver.
    Extend AbstractMountController to use the default implementation.
    void
    Action performed when the rider is controlling the vehicle as a driver.
    This method is called each movement tick of the vehicle.
    void
    Action performed when the rider is controlling the vehicle as a passenger.
    This method is called each movement tick of the vehicle.
    Usually, only dismounting through sneaking is handled here, but there are no limits to what the passenger can do.
    default void
    Update the server-side location of the rider.
    While the entity is visually at the correct location, the position of the rider is not actually updated and would cause unexpected behavior, such as projectiles phasing through the rider, or the rider dismounting at the wrong location.
    This method is called each movement tick of the vehicle.
  • Method Details

    • setEntity

      void setEntity(org.bukkit.entity.Entity entity)
      Set the rider using this controller. Extend AbstractMountController to use the default implementation.
    • setInput

      void setInput(MountController.MountInput input)
      Record the movement input sent by the rider.
      This method is called whenever a new movement control packet is received. Extend AbstractMountController to use the default implementation.
    • setMountable

      void setMountable(Mountable mountable)
    • getEntity

      org.bukkit.entity.Entity getEntity()
      Get the rider. Extend AbstractMountController to use the default implementation.
    • getInput

      Get the movement input. Extend AbstractMountController to use the default implementation.
    • getMountable

      Mountable getMountable()
    • updateDriverMovement

      void updateDriverMovement(MoveController controller, ModeledEntity model)
      Action performed when the rider is controlling the vehicle as a driver.
      This method is called each movement tick of the vehicle.
      Parameters:
      controller - wrapped movement controller of the vehicle
      model - model of the vehicle
    • updatePassengerMovement

      void updatePassengerMovement(MoveController controller, ModeledEntity model)
      Action performed when the rider is controlling the vehicle as a passenger.
      This method is called each movement tick of the vehicle.
      Usually, only dismounting through sneaking is handled here, but there are no limits to what the passenger can do.
      Parameters:
      controller - wrapped movement controller of the vehicle
      model - model of the vehicle
    • updateRiderPosition

      default void updateRiderPosition(MoveController controller, Mountable mountBone)
      Update the server-side location of the rider.
      While the entity is visually at the correct location, the position of the rider is not actually updated and would cause unexpected behavior, such as projectiles phasing through the rider, or the rider dismounting at the wrong location.
      This method is called each movement tick of the vehicle.
      Parameters:
      controller - wrapped movement controller of the vehicle
      mountBone - the mount bone ridden by the rider
    • updateDirection

      void updateDirection(LookController controller, ModeledEntity model)
      Update the look direction of the vehicle.
      This method is called each movement tick of the vehicle, and is only called when the controller is used by a driver.
      Extend AbstractMountController to use the default implementation.
      Parameters:
      controller - wrapped look controller of the vehicle
      model - model of the vehicle