Block powered by redstone event?

Discussion in 'Plugin Development' started by James | Buchanan, May 20, 2012.

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

    Im making a small plugin for my server that makes it so when you click a button thats on a pumpkin, the pumpkin becomes lit and vise/versa.
    Is this possible?
  2. Offline


    Yes, in a PlayerInteractEvent, if a player pushes a button, get the blocks around the button and see if its a pumpkin. If the pumpkin is powered (isPowered()) and get its current state if it is lit or not.
  3. Offline


    To get only the pumpkin the button is attached to you can use
    Block  button = event.getBlock();
    Block attachedTo = button.getRelative(((Button) button.getData()).getAttachedFace().getOppositeFace());
Thread Status:
Not open for further replies.

Share This Page