1.16.5 Get Sign Direction

Discussion in 'Spigot Plugin Development' started by brentspine, Jul 1, 2021.

  1. Hi, so im using signs to let map builders decide what happens on the map, like putting "[Itemshop]" on the map will create an Itemshop on Gamestart. I had a few attempts trying to get the facing, but the facing of the sign is always "SELF", how do i get the actual rotation?
    Thank you for help :3
     
  2. I haven't tested this, but I believe this is what you're looking for.
    Code (Java):
    Sign sign = (Sign) signBlock.getBlockData();
    BlockFace blockFace = sign.getRotation();
     
  3. True, but there's also WallSign, which is a different interface, so type should be checked first.
     
    • Agree Agree x 2
  4. sign.getRotation does not exist
     
  5. Check your import - it should be org.bukkit.block.data.type.Sign
     
    • Like Like x 1
  6. But now it collides with the import "org.bukkit.block.Sign" and when i remove it, the other functions like getLine() doesn't work anymore
     
  7. Then do it like that - org.bukkit.block.data.type.Sign sign = (org.bukkit.block.data.type.Sign) signBlock.getBlockData();
     
    • Like Like x 1
    • Winner Winner x 1