Hello Bukkit, I need the event to leave the Minecart to get cancelled, but it will just let the player leave it anyhow. Code: @EventHandler public void onVehicleExit(VehicleExitEvent event) { Player player = (Player) event.getVehicle().getPassenger(); if(!player.hasPermission("NGOM.CanLeave")) { event.setCancelled(true); player.sendMessage("You're not allowed to leave the Minecart"); } } The message 'You're not allowed to leave the Minecart' shows up, but it still ejects me. The permission works as I removed the exclamation mark and it didn't prompt me that message anymore. Any ideas? Thank you, Cupcakes.
The highest priority makes it run it through that first, yes. The problem is, that I'm not using any other plugins on my test server.
Cupcakes69 That is because Craftbukkit does not care about the cancel. Just make it enter the vehicle 1 tick later Code:java new BukkitRunnable(){ public void run() { event.getVehicle().setPassenger(e.getExited()); }}.runTaskLater(<plugin instance>, 1L);
It just calls the event, but afterwards it does nothing with the event (the VehicleExitEvent variable is just ignored)