Cancelling VehicleEnterEvent teleports player weirdly

XMLWordPrintable

    • Type: Bug
    • Resolution: Invalid
    • Priority: Minor
    • None
    • Affects Version/s: None

      When I use this in my listener class:

      	@EventHandler(priority = EventPriority.HIGHEST)
      	public void onMinecartEnter(VehicleEnterEvent event) {
      		try {
      			if (event.getEntered().getWorld().equals(this.gameMode.getMap().getWorld())) {
      				event.setCancelled(true);
      			}
      		} catch (Exception ex) {
      			ex.printStackTrace();
      		}
      	}
      

      I get teleported to my current location with a slightly higher Y, literally as if I was trying to enter the minecart but then got denied from it (but actually, it should just make you stay in your previous location that you were at when you tried right clicking the minecart).

            Assignee:
            Unassigned
            Reporter:
            Faris Rehman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: