Class VehicleMoveEvent

java.lang.Object
me.hackware.api.event.Event
me.hackware.api.event.impl.VehicleMoveEvent

public class VehicleMoveEvent extends Event
Fired before the vehicle the local player drives (it is the vehicle's controlling passenger) moves. Set a new movement vector to replace the move; leave it alone (the same instance) to keep vanilla's.

When the move is the vehicle's own velocity (a MoverType.SELF move from its travel code), the vehicle keeps the replacement as its velocity afterwards, or getVelocity() when a listener set one.

  • Constructor Summary

    Constructors
    Constructor
    Description
    VehicleMoveEvent(net.minecraft.world.entity.Entity vehicle, net.minecraft.world.entity.MoverType moverType, net.minecraft.world.phys.Vec3 movement)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.phys.Vec3
     
    net.minecraft.world.entity.MoverType
     
    net.minecraft.world.entity.Entity
     
    net.minecraft.world.phys.Vec3
    The velocity the vehicle keeps after a replaced move, or null for the replacement itself.
    void
    setMovement(net.minecraft.world.phys.Vec3 movement)
     
    void
    setVelocity(net.minecraft.world.phys.Vec3 velocity)
     

    Methods inherited from class me.hackware.api.event.Event

    cancel, isCancelled

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VehicleMoveEvent

      public VehicleMoveEvent(net.minecraft.world.entity.Entity vehicle, net.minecraft.world.entity.MoverType moverType, net.minecraft.world.phys.Vec3 movement)
  • Method Details

    • getVehicle

      public net.minecraft.world.entity.Entity getVehicle()
    • getMoverType

      public net.minecraft.world.entity.MoverType getMoverType()
    • getMovement

      public net.minecraft.world.phys.Vec3 getMovement()
    • setMovement

      public void setMovement(net.minecraft.world.phys.Vec3 movement)
    • getVelocity

      public net.minecraft.world.phys.Vec3 getVelocity()
      The velocity the vehicle keeps after a replaced move, or null for the replacement itself.
    • setVelocity

      public void setVelocity(net.minecraft.world.phys.Vec3 velocity)