[SPIGOT-3055] Boat PlayerMoveEvent canceln, bug or mistake ? Created: 09/Feb/17  Updated: 10/Feb/17  Resolved: 09/Feb/17

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Jan U Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: 1.11.2, Bug, Event, Move, boats, mistake


 Description   

I want to make a plugin that Players can't drive in a Vehicle but they can sit in the Vehicle

Video https://youtu.be/0eXJmw5c0UU

Code:

@EventHandler
public void onMove(PlayerMoveEvent e)
{
	if(e.getPlayer().isInsideVehicle())
	{
		e.setCancelled(true);
	}
}


 Comments   
Comment by Jan U [ 10/Feb/17 ]

What I should have mentioned is that it is a race game and would like at the start that the players can not move

Comment by md_5 [ 09/Feb/17 ]

Unfortunately this seems to be working as intended to me.
When you click on the boat, as you can see the player moves into the boat.
This is a move event, which you are cancelling repeatedly, and hence the player is being teleported back.
I don't see a way to avoid this with the event calling, because the placement of the player in the boat is a move which is triggered by the client, only after the player has been attached to the boat.
You might find it acceptable to allow a limited number of moves whilst inside the vehicle, or grant a grace period.

Generated at Sat Dec 13 13:43:25 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.