Solved Cannot change direction of tripwire hook

Discussion in 'Plugin Development' started by HamOmlet, Oct 28, 2012.

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


    I recently stumbled upon this particular thread detailing how to get a block's data during a block place event:

    However, I'm having the same issue when trying to rotate a tripwire hook that is placed at a certain location. It might be worth mentioning that this bit of code is within a delayed task which deals with the block place event. This code is executed after some logic as well, but I figured another delayed task could remedy the problem.

    Here's the code:
    Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
      public void run() {
    The direction always point west. I've tried numerous adjustments but they don't seem to work. It leaves me wondering if it's possible to rotate a placed tripwire hook at this point.
  2. Offline


    to make a block change direction such as pistons and stuff you need to change the data.
    That's how I do it.
  3. Offline


    I do believe I fixed it. I was setting the MaterialData rather than the data itself. Below is how I fixed the issue:

    Instead of doing this:
    e.getBlock().getState().getData().setData((byte) 3);
    Do this:
    e.getBlock().setData((byte) 3);
    Everything seems to be working normally now. Thanks for your advice! ;)
    Vandrake likes this.
Thread Status:
Not open for further replies.

Share This Page