Luohuayu / CatServer

高性能和高兼容性的1.12.2/1.16.5/1.18.2版本Forge+Bukkit+Spigot服务端 (A high performance and high compatibility 1.12.2/1.16.5/1.18.2 version Forge+Bukkit+Spigot server)
https://catmc.org
GNU Lesser General Public License v3.0
1.98k stars 211 forks source link

[1.16.5] Player#getVehicle() returned NULL #786

Closed dayd21git closed 1 year ago

dayd21git commented 1 year ago

Minecraft version: 1.16.5 Build version: 1.16.5-9b57815e Description: When I get on the minecart, I don't get the right information in the code

Code:

@EventHandler
public void PlayerInteractAtEntityEvent(PlayerInteractAtEntityEvent e) {
    Player p = e.getPlayer();
    Bukkit.getConsoleSender().sendMessage("VEHICLE: " + (p.getVehicle() == null ? "NULL" : p.getVehicle().getName()));
}

Console:

[09:53:15] [Server thread/INFO]: VEHICLE: NULL

P.S. I also remind you of two more mistakes that I ask you to correct. https://github.com/Luohuayu/CatServer/issues/783 https://github.com/Luohuayu/CatServer/issues/769 https://github.com/Luohuayu/CatServer/issues/766

dayd21git commented 1 year ago

I checked the new version of the server. The new version returns the transport, but this does not always happen. I clicked on the transport 5 times, got NULL 3 times.

Kotori0629 commented 1 year ago

image I tested on Paper1.16.5/Paper1.20.1, the current vehicle always null.