Bug? vehicleExitEvent doesn't seem to trigger?!

Discussion in 'Plugin Development' started by jkctech, Nov 17, 2014.

Thread Status:
Not open for further replies.
  1. Hello, i am working on a plugin and a system to cancel the exit event when you ride a slime, but it doesnt trigger...
    however it does when you are in a Minecart, but not when riding a mob.

    this is my code with debug message included:
    Code:java
    1. @EventHandler
    2. public void onVehicleExit(VehicleExitEvent event) {
    3. System.out.println("EJECT");
    4. event.setCancelled(true);
    5. }



    thanks in advance!


    EDIT:
    also, is it possible to move the slime when riding?
    like, when i ride it, i can move forwards and such.
     
  2. Offline

    Lolmewn

    You did register the event, right?
    Also, wrong section.
     
  3. yes, i did register the events, sorry for the wrong section thing.
    but do you have any alternative or fix?
     
  4. Offline

    mythbusterma

    jkctech

    That's because a Slime isn't a vehicle, this is one of the peculiarities of Bukkit, in that Minecarts are entities and Vehicles. It won't trigger this event when you get off a Slime.
     
    Konato_K likes this.
  5. is there an event that WILL trigger, or is this just impossible?
     
  6. Offline

    mythbusterma

    jkctech

    Well, since I suspect you're using Spigot anyway, they have an EntityDismountEvent, I don't know how you would do this strictly with Bukkit, however.
     
  7. Offline

    ChipDev

    I tested with PlayerMoveEvent.
    *Better to use spigot :p
     
Thread Status:
Not open for further replies.

Share This Page