Converting a Sign to a TileEntitySign

Discussion in 'Spigot Plugin Development' started by ServersForLiam, May 31, 2015.

  1. Before I Start off i want to just say this post was in the wrong fourm. I have informed the Spigot Fourm Moderators for this and it should be sorted. So this shouldnt be double posting

    Hey Guys, It's HungerCade Here,

    As you can See By the Title I Would Like to Convert a Sign to a TileEntitySign,
    So I Can Troll My Brother on a Chat Event.


  2. If your goal is to alter the text on a sign, it'd be better to stick to the Bukkit API and use org.bukkit.block.Sign instead of net.minecraft.server.TileEntitySign.

    Example sign text editing:
    Code (Text):
    if(player.getLocation().getBlock().getState() instanceof Sign){
         Sign sign = (Sign)player.getLocation().getBlock().getState();
         sign.setLine(0, "This is row 1");
         sign.setLine(1, "This is row 2");
         sign.setLine(2, "This is row 3");
         sign.setLine(3, "This is row 4");
         sign.update();//<- It's important to update the Sign block-state after editing it.
  3. In case you still need it, there's a getTileEntity(x, y, z) method in net.minecraft.server.World (afaik)
    • Agree Agree x 1
  4. But how do i open a sign to a player
  5. A Sign that isnt in the world
  6. Send a block change, open the GUI, undo the block change. (Player#sendBlockChange could be of help here)
    • Agree Agree x 2