Closed SirLeezus closed 3 months ago
i would guess this is because the platform doesn't throw VehicleMoveEvent for non-Vehicle entities, and since spigot also doesn't have EntityMoveEvent, there's no way for us to track this really.
i would guess this is because the platform doesn't throw VehicleMoveEvent for non-Vehicle entities, and since spigot also doesn't have EntityMoveEvent, there's no way for us to track this really.
Yup, you are 100% correct, resolved it with this code:
@EventHandler
public void onRidingPet(PlayerMoveEvent e) {
if (e.getPlayer().getVehicle() == null) return;
if (!pets.getPetManager().isPet(e.getPlayer().getVehicle())) return;
Bukkit.getServer().getPluginManager().callEvent(new VehicleMoveEvent((Vehicle) e.getPlayer().getVehicle(), e.getFrom(), e.getTo()));
}
Thank you! I'll close this now.
nvm, that did not resolve the problem. Not sure why but it sometimes works correctly, threw me off.
Due to not being able to track this, I'll just go ahead and close it again. I resolved it by simply not allowing pet riding in regions.
WorldEdit Version
7.3.0
WorldGuard Version
7.0.9
Platform Version
Paper-450 1.20.4
Confirmations
Bug Description
I created a pet plugin where the player can ride entities they normally can't. On a very fundamental level the plugin just simply adds the player as a passenger on the entity
entity.addPassenger(player)
and has a custom controller for movement. For some reason when a player rides one of these custom pets in a protected region with the flag "invincible" on and then leaves that region they are still invincible, as if they were still in the region. As soon as the player unmounts they'll start taking damage again.Expected Behavior
I expected to not be invincible when leaving the region on a entity you normally can't ride.
Reproduction Steps
entity.addPassenger(player)
in regionOptional WorldGuard-Report
No response
Anything Else?
No response