Who or what triggers pressureplate

Discussion in 'Plugin Development' started by w00tklumpWn, Jan 26, 2012.

Thread Status:
Not open for further replies.
  1. Hi!

    Any idea, how i can find out who or what triggers a pressureplate? I played around with the BlockInteractEvent, but found nothing in this manner.

    greets,
    Wutklumpen
     
  2. Offline

    desht

    You need the PlayerInteractEvent for this, and check if event.getAction() == Action.PHYSICAL (amusingly described in the Javadocs as "ass-pressure").
     
    Europia79 and puyttre like this.
  3. Yeah, thats the "who". But what, if an item is triggering to plate? Does the item also function as "Player"?
     
  4. Offline

    Bruno Lanevik

    You might wanna use the
    ENTITY_INTERACT
    Event instead
     
  5. Nothing interesting in the EntityInteractEvent. There is a event.getEntity() but i can't do anything with it.
     
  6. Offline

    Bruno Lanevik

  7. AH! So if i call
    Code:
    event.getEntity().getClass();
    , i could get the Item's class and cast it? Can't wait to try that! :D
     
  8. if(event.getEntity() instanceof Item)
    ;)
     
Thread Status:
Not open for further replies.

Share This Page