Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-4074

Creating Block Data From String Not Setting On Block

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • Windows 10, 64-bit

    • 1.13-pre.7 (git-Spigot-83d9d09-80fefcf)

      I created a command in attempt to copy the block data from a string then create block data out of that using the new Bukkit createBlockData feature that was added, but the block data is not being set on that block at all.

      In the image below, the bottom chest is the chest that I want to copy, and the top chest is the result. This shows two different setups, both chests created fail to face the correct way, and the chest on the right that is waterlogged does not set as well.
      http://prntscr.com/k8lyza

      I have also tested and confirmed this does not work either on ender chests, anvils, furnaces, end rods, carved pumpkins, signs, doors, trapdoors, stairs, rails, fence gates, repeaters/comparators, beds, banners, redstone type blocks (pistions, dispensers, hoppers, etc), and those where the only ones I could find.

       

      Code:

      Player p = (Player)sender;
      Block originalBlock = p.getLocation().getBlock().getRelative(0, -1, 0);
      BlockData blockData = Bukkit.getServer().createBlockData(originalBlock.getType(), originalBlock.getBlockData().toString());
      Block copyBlock = originalBlock.getRelative(0, 3, 0);
      copyBlock.setBlockData(blockData, true);
      

      (I attached the screenshot and the plugin I had that ONLY tests the block data values)

            Unassigned Unassigned
            YourCoal YourCoal
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: