Get Player

Discussion in 'Plugin Development' started by MC_Player, Dec 10, 2011.

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

    MC_Player

    How can I get the player in a BlockRedstoneEvent, I tried this,
    Code:
    Player player = e.getPlayer();
    But that does not work.. :s
     
  2. Offline

    steffengy

    you can't that easy
     
  3. Offline

    mahoutsukaii

    @MC_Player there is no Player part to BlockRedstoneEvent, as that only handles when a current has changed state to a block.

    I'm assuming you want something to happen if a redstone torch or some wire is placed?
    If this is the case, you'd have to check for a BlockPlaceEvent or BlockDestroyEvent, and see if the block involved has something to do with redstone.
     
  4. Offline

    theguynextdoor

  5. Offline

    DomovoiButler

    maybe check the location of the block and forLoop all players location and see whose the nearest on that block?
     
  6. Offline

    Slamakans

    Tell me what you want the plug-in to do and then post the code, we might be able to do a work around on the issue.
     
  7. Offline

    MC_Player

    I want to get who turned the redstone on, sorry i cannot reach any code now.
     
  8. Offline

    Slamakans

    Doesn't exist a such class/method in the bukkit.jar, sorry.
     
  9. Offline

    CptSausage

    Try to use the "onPlayerInteract" Event and see if someone uses a lever or button.
     
Thread Status:
Not open for further replies.

Share This Page