Make player ride entity SETS passengers, does not ADD them (distinction?)
bergerkiller opened this issue ยท 2 comments
Skript/Server Version
User reported version 2.8.0
Bug Description
[Disclaimer: this is from another user that had this problem]
User had the following skript:
on right click on minecart:
make player ride entity
This resulted in a strange bug when used with TrainCarts (or I guess boats too): since traincarts supports multiple seats per cart (custom carts), existing players get ejected when players enter the cart.
I assume that instead of adding the player as passenger, it set the passengers of the cart to this one player.
This might be intentional if the idea of this was to 'swap' passengers when entering, but as a plugin dev this behavior is not predictable, and it's not exactly clear from the statement that this is what it does.
Expected Behavior
Only add the player as passenger to the minecart. Not eject existing, other, players when using "make player ride entity"
Steps to Reproduce
Install skript + traincarts, configure a cart with multiple seats.
Can probably also reproduce using a boat.
Errors or Screenshots
No response
Other
No response
Agreement
- I have read the guidelines above and affirm I am following them with this report.
I think we could do it such that it adds the entity if there's an open passenger slot, else it ejects the first passenger and adds the new entity to the vehicle's passengers.
I don't think we should get rid of the behavior of ejecting the current passenger if the vehicle is full, but I suppose that's up to debate. I'd like other opinions!
Usually this is supposed to be handled using passengers of entity
instead of using Ride effect. There is a PR improving Passengers and it also has a good choice stating this subject.
If we really need to do this for ride effect then we can add an extra option to the syntax like make player ride event-entity without ejecting others
(just PoC, proposed syntax should better be improved)