Skip to content

Add PlayerMoveVehicleEvent#11835

Closed
Owen1212055 wants to merge 2 commits into
mainfrom
feat/PlayerMoveEvent-Vehicle-Improvement
Closed

Add PlayerMoveVehicleEvent#11835
Owen1212055 wants to merge 2 commits into
mainfrom
feat/PlayerMoveEvent-Vehicle-Improvement

Conversation

@Owen1212055
Copy link
Copy Markdown
Member

@Owen1212055 Owen1212055 commented Dec 27, 2024

Reworked Vehicle PlayerMoveEvent Handling

The PlayerMoveEvent is triggered whenever a player controls a vehicle.
This event is generally broken, and does not represent what is actually happen. For example, the event used the player's location as the "from" position and the vehicle's location as the "to" position. This caused significant issues and confusion:

  • Teleporting the player from within this event was undone later by a positionPassengers call, rendering setTo calls effectively useless.
  • Cancelling the event led to desyncs and odd behavior, such as the player being rapidly teleported between two locations.
  • The event was not giving a straightforward way to control the actual movement of the player on a vehicle.

Fixes:
#8214
#7021

In order to best clean up the event logic, the solution is to center the event around the vehicle rather than the player.

8mb.video-Ear-qyB5Bf5T.mp4

@Owen1212055 Owen1212055 requested a review from a team as a code owner December 27, 2024 05:22
@NonSwag
Copy link
Copy Markdown
Contributor

NonSwag commented Dec 27, 2024

This Potentially resolves #11633

@NonSwag
Copy link
Copy Markdown
Contributor

NonSwag commented Dec 27, 2024

I would suggest improving the vehicle move event and/or adding a "mount steer event" and completely stop calling the player move event for passengers

@Leguan16
Copy link
Copy Markdown
Contributor

A VehicleMovePlayerEvent would be nice. (See #7791)

@NonSwag
Copy link
Copy Markdown
Contributor

NonSwag commented Dec 27, 2024

I think a PlayerSteerMountEvent would cover more cases
the event could be called for any entity the player is riding steerable or not
it could provide the exact inputs (jump left right forward backward and maybe dismount?)
and also provide the from and to location and even the applied vector
this wouldn't restrict the even to only movements but every steering input
in case the ridden entity is not steerable by the player the even could just be cancelled by default and/or not provide from and to

One case I didn't think about in advance that came to mind while writing this are pigs and striders
they are controlled by the players held item and therefore this event would not represent the movement properly

@electronicboy
Copy link
Copy Markdown
Member

The problem with vehicle movement is that there are a lot of overarching concepts which look similar but are entirely different, there were discussions over input events in the past, and there was no viable workable solution that I could see for providing events which are actually useful to devs within the context of the discussions they had (i.e. overriding the entities move controller)

@Owen1212055 Owen1212055 force-pushed the feat/PlayerMoveEvent-Vehicle-Improvement branch from 741bb6d to 7f778ba Compare March 3, 2025 17:07
@Owen1212055 Owen1212055 changed the title Reworked Vehicle PlayerMoveEvent Handling Add PlayerMoveVehicleEvent Mar 3, 2025
@kashike kashike added the type: feature Request for a new Feature. label Apr 5, 2025
@Owen1212055
Copy link
Copy Markdown
Member Author

I have no interest in upkeeping this.

In the end, we upkeep a breaking change for an "exploit" that is most likely not relevant nowadays. So until that is removed, riding statistics will not work.

@Owen1212055 Owen1212055 closed this Apr 4, 2026
@github-project-automation github-project-automation Bot moved this from Awaiting review to Closed in Paper PR Queue Apr 4, 2026
@Owen1212055 Owen1212055 deleted the feat/PlayerMoveEvent-Vehicle-Improvement branch April 4, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature Request for a new Feature.

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

5 participants