How to refresh signs?

Discussion in 'Plugin Development' started by Schwarzer Zylinder, Oct 13, 2011.

Thread Status:
Not open for further replies.
  1. Hi,
    my plugin changes the text in signs with the code
    Code:
    sign.setLine(3, "blabla");
    But the problem is, the players have to rejoin the server to see this changes.
    Is there any way to refresh the signs immediately?

    Second question: I want to drop a sign, I used the command:
    Code:
    block.setType(Material.AIR);
    world.dropItemNaturally(block.getLocation(), new ItemStack(Material.SIGN));
    block is the block where the sign stands, I delete this block (set it air) and drop a new sign at this position.
    The sign get dropped, but I cant take it?
     
  2. Offline

    bergerkiller

    1.
    Use sign.update(true);

    2.
    Code:
    world.dropItemNaturally(block.getLocation(), new ItemStack(Material.SIGN, 1));
    I believe you need to set the amount of the itemstack too..could be it was set at 0 items.
     
  3. Both works, thanks a lot!
    sign.update() works too
     
Thread Status:
Not open for further replies.

Share This Page