[SPIGOT-1943] setPassenger() is cooldowned for 3 seconds after calling eject(). Created: 16/Mar/16  Updated: 17/Mar/16  Resolved: 17/Mar/16

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Mathias K. Assignee: Unassigned
Resolution: Invalid Votes: 0
Labels: 1.9, Bug, Spigot
Environment:

Spigot 1.9



 Description   

Unable to set entity again as a passenger for 3 seconds after calling eject() method.
Reproducing:
[code]Sheep sheep = (Sheep) player.getPassenger();
sheep.eject();
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
public void run()

{ player.setPassenger(sheep); // Doesn't let me to set the sheep as a passenger for 3 seconds. }

}, 20L);[/code]

What I did to get around it temporary:
[code]Sheep sheep = (Sheep) player.getPassenger();
sheep.eject();
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
public void run()

{ sheep.remove(); Sheep newSheep = sheep.getWorld().spawn(sheep.getLocation(), Sheep.class); player.setPassenger(newSheep); // Works... }

}, 20L);[/code]



 Comments   
Comment by Mathias K. [ 17/Mar/16 ]

@md_5 I set the timer to one second to clearly see that it won't let me to set the sheep as a passenger. If I would set the time to 3+ seconds, then it would work.

Comment by Black Hole [ 17/Mar/16 ]

Vanilla issue: Tracking of entities in vehicles is messed up. Let's hope for 1.9.1 or 1.9.2

Comment by PseudoKnight [ 17/Mar/16 ]

I think it's more than a cooldown issue. I can't see entities I set as a passenger on my own player entity. They continue to appear at their original location. (Sometimes the entity will appear to teleport onto my head before springing back.) When I walk to a new location and eject them, it appears to teleport over to me. If I was to set that entity as a passenger on a different player entity than my own, it appears as if the entity is riding that player correctly. This suggests it's a client bug. It may or may not be the same issue as mentioned above, but should be taken into consideration.

Comment by md_5 [ 16/Mar/16 ]

Your timer in that code is 1 second btw.

Comment by Mathias K. [ 16/Mar/16 ]

Sorry about these [code] tags, it seems that I can't edit the issue anymore to fix them.

Generated at Fri Apr 11 15:51:05 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.