Solved Double plant blocks

Discussion in 'Plugin Development' started by Tommy_T0mmY, Aug 19, 2019.

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

    Tommy_T0mmY

    I've been trying for hours to spawn a double flower for version 1.12, I read the documentation and other solutions but without success, for now the plugin is able to spawn a double plant but it's glitched (attached photo). I'm on 1.12.2
    Image (open)
    plant.png

    Here's my code
    Code:
    Block top = ...;
    Block bottom = ...;
    bottom.setType(XMaterial.ROSE_BUSH.parseItem().getType(), false); //Material.ROSE_BUSH
    MaterialData mdbottom = bottom.getState().getData();
    mdbottom.setData((byte) 4);
    top.setType(XMaterial.ROSE_BUSH.parseItem().getType(), false); //Material.ROSE_BUSH
    MaterialData mdtop = top.getState().getData();
    mdtop.setData((byte) 10);
    Edit: solved with this code
    Code:
    bottom.setType(Material.DOUBLE_PLANT);
    bottom.setData((byte) 4);
    top.setType(Material.DOUBLE_PLANT);
    top.setData((byte) 10);
     
    Last edited: Aug 19, 2019
Thread Status:
Not open for further replies.

Share This Page