How can I set vehicle and clearPassengers in sponge 8.0?

How can I set vehicle and clearPassengers in sponge 8.0 ?

Please help me.

A few of ways, all revolving around the same idea

Entity base;
Entity passenger;

base.passengers().add(passenger);

and then to clear

Entity base;
Entity passenger;

base.passengers().remove(passenger);

One of the other ways would be to go down the vehicle route

Entity base;
Entity passenger;

passenger.offer(Keys.VEHICLE, base);
1 Like

Thank you so much!