Open Leguan16 opened 2 years ago
The fact that it triggers in a boat sounds like the actual bug here The player isn't moving, the vehicle that they're riding is, is the notation here
Does the boat move event get triggered on Spigot?
Which boat move event?
Ideally we would call the move event, but only with rotational values, or create a new event for (relative) rotation changes inside of a vehicle ... if you're only looking for x,y,z coordinate changes, you need to listen to VehicleMoveEvent
Personally I would expect player move event to be fired as well as the player is changing positions. You can get the vehicle from a player with Player#getVehicle() as well. This method wouldn't be there if this event isn't supposed to be fired when moving in a vehicle?
--edit-- just checked the javadocs for Vehicle Entities. Vehicle all subinterfaces are: AbstractHorse, Boat, ChestedHorse, CommandMinecart, Donkey, ExplosiveMinecart, HopperMinecart, Horse, Llama, Minecart, Mule, Pig, PoweredMinecart, RideableMinecart, SkeletonHorse, SpawnerMinecart, StorageMinecart, Strider, TraderLlama, ZombieHorse
The PlayerMoveEvent is called for moving with every single vehicle with the exception of minecarts and llamas
It has already been reported back in 2019 https://hub.spigotmc.org/jira/browse/SPIGOT-4568
Then it would be better to create an event that fires when an entity called EntityMoveEvent rather than PlayerMoveEvent moves. PlayerMoveEvent means the player moves directly.
Maybe a PlayerMoveInVehicleEvent
?
VehicleMoveEvent
maybe?
Did you write that because ”it already exists”?
Hum
Generally speaking, this issue appears for any vehicle that considers the player the controlling passenger. Spigot actively just calls move events for any of these (see here).
Hence, PlayerMoveEvents are called for all of the following entities:
// edit: How to solve this is up to whoever works on this. Calling player move events for every passanger would be doable by just listening to the vehicle move packet, however that is a philosophical question and I'd prefer if we had proper events for players moving inside or on top of vehicle instead.
Would that new event then be called instead of the PlayerMoveEvent
or additionally. I feel it should be consistent between all kind of vehicles that if you move inside/with it the same event gets called. No matter if you are steering the vehicle or not.
Expected behavior
I recently discovered that the PlayerMoveEvent does not trigger when moving in a minecart or on a llama. But due to the fact that it triggers when moving in a boat I also expect it to trigger when moving in a minecart.
Observed/Actual behavior
It does not trigger the event when moving in a minecart or on a llama.
Steps/models to reproduce
Just to show if a player is moving or not:
Hop in a minecart and you will see that it does not trigger the event. If you hop in a boat and move it will trigger the event.
Plugin and Datapack List
just the plugin with the handler.
Paper version
This server is running Paper version git-Paper-317 (MC: 1.18.2) (Implementing API version 1.18.2-R0.1-SNAPSHOT) (Git: e5da93a) You are running the latest version Previous version: git-Paper-302 (MC: 1.18.2)
Other
No response