Interface MountController
- All Known Implementing Classes:
AbstractMountController
,FlyingMountController
,FlyingMountController_v16
,FlyingMountForcedController
,WalkingMountController
,WalkingMountForcedController
public interface MountController
Interface used by
While not strictly necessary, we recommend registering the controller with
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
Modifier and TypeInterfaceDescriptionstatic class
Data class containing the movement control sent by a player. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.entity.Entity
Get the rider.getInput()
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
setMountable
(Mountable mountable) 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.
ExtendAbstractMountController
to use the default implementation.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.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.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.
-
Method Details
-
setEntity
void setEntity(org.bukkit.entity.Entity entity) Set the rider using this controller. ExtendAbstractMountController
to use the default implementation. -
setInput
Record the movement input sent by the rider.
This method is called whenever a new movement control packet is received. ExtendAbstractMountController
to use the default implementation. -
setMountable
-
getEntity
org.bukkit.entity.Entity getEntity()Get the rider. ExtendAbstractMountController
to use the default implementation. -
getInput
MountController.MountInput getInput()Get the movement input. ExtendAbstractMountController
to use the default implementation. -
getMountable
Mountable getMountable() -
updateDriverMovement
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 vehiclemodel
- model of the vehicle
-
updatePassengerMovement
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 vehiclemodel
- model of the vehicle
-
updateRiderPosition
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 vehiclemountBone
- the mount bone ridden by the rider
-
updateDirection
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.
ExtendAbstractMountController
to use the default implementation.- Parameters:
controller
- wrapped look controller of the vehiclemodel
- model of the vehicle
-