How do i check if a boat breaks

Discussion in 'Plugin Development' started by spookyDHD, Jan 4, 2014.

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

    spookyDHD

    How do i check if a boat breaks?
     
  2. Offline

    PhilipsNostrum

    What do you mean? Like what event listener you can use to get a boat when it breaks?
     
  3. Offline

    spookyDHD

    I want to detect if a boat hits a block and breaks
     
  4. Offline

    PhilipsNostrum

    You can use VehicleBlockCollisionEvent I believe
     
  5. Offline

    spookyDHD

    i know but i don't know how to detect it.
     
  6. Offline

    PhilipsNostrum

    Dude it's an event, meaning that you make your class implement Listener, you add this to your onenable:
    Code:
    getServer().getPluginManager().registerEvents(this,this);
    
    And then somewhere you do
    Code:
    @EventHandler
    public void onVehicleBlockHit(VehicleBlockCollisionEvent e){
    //do stuff
    }
    
    That bit of code will be ran every time a vehicle hits a block
     
  7. Offline

    spookyDHD

    Is it possible to detect it when its breaks?
     
  8. Offline

    PhilipsNostrum

Thread Status:
Not open for further replies.

Share This Page