1.8.8 Melon/Pumpkin stem direction

Discussion in 'Spigot Plugin Development' started by Sletonn, Jan 26, 2020.

  1. Hello, how would I set the facing direction of a melon stem?
    I’ve read via nbt but how would I do this when I only have the location?

    Thanks.
     
  2. Make sure to validate it's a melon stem :)

    Code (Java):
            Location l; /* Your location */
            Block b = l.getBlock();
            MaterialData d = b.getState().getData();
            Directional e = (Directional) d;
            e.setFacingDirection(BlockFace.EAST);
     
  3. I didn’t think about that! Thank you!
     
  4. Sorry to bother again, but I did what you said and I'm getting this error, I tried finding out but I can't:

     
  5. try just using block.getState()
     
  6. Doesn't work either, I'm still getting a ClassCastException...
    We can maybe only do it through nbt
     
  7. FrostedSnowman

    Resource Staff

    There is no such implementation for the stem- only setting the age. You can either make a feature request for this or manually change it yourself using nbt
     
  8. How would I do it via nbt ?
     
  9. FrostedSnowman

    Resource Staff

    You'll need to get the nms block
     
  10. FrostedSnowman

    Resource Staff

    Second thought, you should just be able to manipulate the nms block data without touching nbt directly
     
  11. There's the updateShape method in BlockStem it might be the method for it or not. Do you have any idea ?