Event Handler

Discussion in 'Plugin Development' started by Qearlot, Jul 28, 2018.

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

    Qearlot

    How event need to use for get block(chest) at location?

    And set item in this block*

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
  2. Online

    timtower Administrator Administrator Moderator

  3. Offline

    Qearlot

    I wanna ask people. I don't know :(
     
  4. Online

    timtower Administrator Administrator Moderator

    @Qearlot Based on the information you gave: no event is suitable for you.
    What do you want to do?
     
  5. @Qearlot
    There is a method for this. I think its in the world class
    Its world.getBlockAt(yourLocation);

    Then you can see if that block is a chest
    If so cast it to a chest, get the block inventory and then add your item
     
  6. Offline

    Qearlot

    So, how i can cast to chest? For Chest?
     
  7. Offline

    KarimAKL

    @Qearlot
    Code:Java
    1. Chest whatever = (Chest) world.getBlockAt(location);
     
  8. Offline

    Tabuu_

    PHP:
    Chest whatever = (Chestworld.getBlockAt(location).getState();
     
  9. Offline

    KarimAKL

Thread Status:
Not open for further replies.

Share This Page