1.15.2 Placing Skull as a Block

Discussion in 'Spigot Plugin Development' started by BersamBas, Feb 19, 2020.

  1. Hello, I am trying to place a Custom Skull as a block.

    This is currently what I have.
    Code (Text):
            Block b = loc1.getBlock();
            Skull s = (Skull) b.getState();
            ItemStack skull = Utils.getCustomTextureHead(texture);
    I am a bit stuck on How I would go from ItemStack to Block, if that even is possible.

    NOTE: I am using a Custom Texture, I cannot use s.setOwning(OfflinePlayer);

    Thank you for the help in advance.
  2. You can't go from ItemStack to Block. A Block is a place in the world where a 'block' can be placed. An ItemStack is simply an item. To change a block in the world, you'll need to set its type and (additionaly its block data).