Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-2660

Cancelling VehicleEnterEvent teleports player weirdly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Minor Minor
    • None
    • 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).

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

              Created:
              Updated:
              Resolved: