EntityInteractEvent?

Discussion in 'Plugin Development' started by Minibros, Nov 21, 2015.

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

    Minibros

    Greetings,
    How can you detect if an Entity stands on an wooden preasure plate at a specific location, and then do Something.
     
  2. Offline

    mcdorli

    entity interact event

    use event.getAction(), and see if it equals Action.PHYSICAL
     
    Zombie_Striker likes this.
  3. Offline

    Minibros

    @mcdorli it doent works.
    if (event.getAction().equals(Action.PHYSICAL)) {

    }
    The method getAction() is undefined for the type EntityInteractEvent
     
  4. Offline

    Scimiguy

    @Minibros
    He's thinking of PlayerInteractEvent.
    There's no clean way to do it for entities, just players.

    Your best bet is probably BlockRedstoneEvent
     
  5. Offline

    Minibros

    @Scimiguy but how do you know who triggers a wooden preasure plate?
    Like instanceof Monster
     
  6. Offline

    mcdorli

    Don't use .equals for enums, use ==
    @Scimiguy Yes I am. The you need to check, if the player is standing on a pressure plate
    PlayerInteractEvent
     
  7. Offline

    Minibros

    @mcdorli
    How do you check if a iron golem stands on a preasure plate?
     
  8. Offline

    mcdorli

  9. Offline

    Scimiguy

    Well that's weird, I swear that getBlock() method wasn't there when I looked before.
     
  10. Offline

    mcdorli

    Maybe you looked into the bukkit one. ...No it is there.
     
Thread Status:
Not open for further replies.

Share This Page