VehicleDestoyEvent help

Discussion in 'Plugin Development' started by XSilver_FalconX, Feb 2, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    XSilver_FalconX

    Hi, I'm trying to get what a vehicle drops when it gets destroyed then from there remove it, but so far I haven't been able to even check what it did drop. Anyone have any insight on this?
    Thanks!
     
  2. I don't know the code for this, but here is what you need to do:
    Get a listener for the OnVehicleDestroy event.
    Set it to listen to the whole world (or a region)
    Set it to destroy all items in that area, or set it to destroy all possible vehicle drops (minecart,boat, e.t.c)
     
  3. Offline

    XSilver_FalconX

    would it be possible to get the nearby drops in a 5 x 5 radius from where the vehicle was destroyed. and btw I already have the listener set up and it can currently tell when a vehicle gets destroyed
     
  4. You need to pinpoint the area where the vehicle was destroyed.
    getLocation.() I think
     
  5. Offline

    XSilver_FalconX

    event.getVehicle().getLocation() but .getLocation doesn't provide anything like .getNearbyEntities(location);

    public void OnVehicleDestroyEvent(VehicleDestroyEvent event) {
    System.out.print("Listener is indeed working!");
    Location loca = event.getVehicle().getLocation();
    Vehicle v = event.getVehicle();
    if (v instanceof Boat) {
    //how do I find the drops?
    }
    }

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 31, 2016
  6. Idk about drops, search "itemStack" perhaps?
     
  7. Offline

    XSilver_FalconX

Thread Status:
Not open for further replies.

Share This Page