PaperMC / PaperMC/Paper

VehicleEnterEvent is thrown when a plugin adds a passenger to a vehicle

Open
#11,930 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: needs triage
Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

Is your feature request related to a problem?

When using Entity#addPassenger, the event that is thrown - VehicleEnterEvent should it be a vehicle. The same is done when a player manually enters a vehicle. If you want to cancel the event, there is no straightforward way to distinguish between these two causes.

Describe the solution you'd like.

Add getVehicleEnterCause to VehicleEnterEvent, similar to TeleportCause

Describe alternatives you've considered.

Cancelling the interact event instead, though it's a bit less clean of a workaround. A way to properly distinguish player vs plugin passenger adding would be ideal

Other

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names Entity#addPassenger, VehicleEnterEvent, and TeleportCause; read these API entry points first to understand how manual and plugin-driven entry are represented. Done means VehicleEnterEvent exposes a documented cause that lets listeners distinguish the two paths, with matching event tests if the repository has coverage for them.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.