Individual Signs

Sign

Description

Displays the text on signs for each player individual differently.
Right now, it just replaces "[PLAYER]" on the sign with the name of the player looking at it.
So when two players look at a sign at the same time with "[PLAYER]" on it somewhere they will see a different text.
You don't believe me? Then test it out for yourself!
This could be used for a individual greeting sign at your spawn.
Permission to create a sign with "[PLAYER]" on it: insigns.create.player

How this works

To achieve this, the plugin manipulates the sign packet that is sent to a player.
But keep in mind, that each line only can hold 15 characters. So if the text is longer, it will automatically cut it at the 15's character. If the next lines are empty, the plugin will try to continue there.

IMPORTANT

This plugin needs ProtocolLib to work.
Make sure you have installed the right version of ProtocolLib.

Quick Presentation by VariationVault


For plugin developers: easy-to-use API

Here is a small example of how you can use this in your own plugin to display player-specific values on signs.
1.) First of all: add the Individual_Signs jar to your build path (just like you do it with the bukkit.jar)
2.) You can then create a listener which listens for the SignSendEvent (just like you create listeners for bukkit events): this event gets called every time the server is about to send a player the text of a sign.
3.) The event provides easy methods to get the current sign text and to change it:

  • getPlayer() - Gets the player which receives the sign packet.
  • getLocation() - Gets the location of the sign which text is being sent.
  • getLine(int index) - Gets the line of text at the specified index (0-3).
  • setLine(int index, String line) - Sets the line of text at the specified index.
  • Note that lines longer than the allowed 15 characters will be either cut or continued in the next lines (if those are empty) AFTER the event is over.
  • isModified() - Whether or not this event was already modified by some plugin.
  • setCancelled(boolean cancelled) - If the event is cancelled the sign packet will not be sent to the player, leaving the sign blank.
  • isCancelled() - Checks whether or not some plugin cancelled this event already.

Example usage of the event to replace "[PLAYER]" with the player's name:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
public class SignSendListener implements Listener {

    public SignSendListener(Plugin plugin) {
        Bukkit.getServer().getPluginManager().registerEvents(this, plugin);
    }

    @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
    public void onSignSend(SignSendEvent event) {
        for (int i = 0; i < 4; i++) {
            String line = event.getLine(i);
            if (line.contains("[PLAYER]")) {
                event.setLine(i, line.replace("[PLAYER]", event.getPlayer().getName()));
            }
        }
    }
}

That's it. The InSigns-Plugin will handle all the needed packet manipulation for you.

Some other useful utilities provided by InSigns are:

  • the static method InSigns.sendSignChange(Player player, Sign sign) - Sends a SignUpdate-Packet to the specified player. Useful if you want to update certain signs periodically.
  • the SimpleChanger class, which can be used to easily create a listener for simple key->value replacements and permission checks during sign creation. Example for the built-in [PLAYER] -> playerName replacement:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
@Override
public void onEnable() {
    Plugin insignsPlugin = getServer().getPluginManager().getPlugin("InSigns");
    if ((insignsPlugin != null) && insignsPlugin.isEnabled()) {
        // replaces "[PLAYER]" with the player's name on signs and checks for the 'insigns.create.player' permission
        // whenever a player tries to create a sign with "[PLAYER]" on it
        new SimpleChanger(this, "[PLAYER]", "insigns.create.player") {
            @Override
            public String getValue(Player player, Location location, String originalLine) {
                return player.getName();
            }
        };
        System.out.println("Plugin 'InSigns' found. Using it now.");
    } else {
        System.out.println("Plugin 'InSigns' not found. Additional sign features disabled.");
    }
}


Changelog

changelog

Notice

This plugin uses Hidendra's Metrics class to report usage stats to mcstats.org. This can be disable by setting 'metrics-stats' to false in the config.

Similar plugins

Are you looking for individual player heads? Then IndividualHeads might be the right plugin for you!

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of blablubbabc blablubbabc Mar 09, 2014 at 16:06 UTC - 0 likes

    @altair123ezio: Go

    This plugin is doing nothing related to colors. You have to use a different plugin which converts color codes to colors. However you should be able to use colors and this plugin togteher without problems (like on the screenshoot in the corner above).

  • Avatar of altair123ezio altair123ezio Mar 09, 2014 at 14:07 UTC - 0 likes

    why i cant put colors in signs?

  • Avatar of acidBLOCKS acidBLOCKS Jan 28, 2014 at 11:38 UTC - 1 like

    Love this plugin! Thanks for making it @blablubbabc

  • Avatar of stealth2800 stealth2800 Dec 22, 2013 at 06:52 UTC - 0 likes

    @talariuss: Go

    - Points to the comment directly below yours -

  • Avatar of talariuss talariuss Dec 21, 2013 at 06:27 UTC - 0 likes

    update to 1.7 please!

  • Avatar of blablubbabc blablubbabc Dec 18, 2013 at 18:41 UTC - 0 likes

    v1.5

    • Updated to MC 1.7: Make sure to use the latest server and ProtocolLib versions.
  • Avatar of Tobseb Tobseb Nov 14, 2013 at 20:51 UTC - 0 likes

    @kikotte: Go

    But that would be a Block-Update, not a Chunk-Update... :P :)

    Get the latest NoCheatPlus.jar here!
    (Development builds of this project can be acquired at the provided continuous integration server. These builds have not been approved by the BukkitDev staff.)

    (Use it at your own risk!)

  • Avatar of kikotte kikotte Nov 10, 2013 at 04:10 UTC - 0 likes

    @blablubbabc: Go

    I'm trying to make an api but when I've made ​​it so you have to log out for it to update itself.

  • Avatar of blablubbabc blablubbabc Nov 10, 2013 at 04:03 UTC - 0 likes

    @kikotte: Go

    What are you talking about?

  • Avatar of kikotte kikotte Nov 10, 2013 at 03:41 UTC - 0 likes

    Too bad you have not done the update chunk.

Facts

Date created
Sep 18, 2012
Category
Last update
Jan 14, 2014
Development stage
Release
Language
  • deDE
  • enUS
License
All Rights Reserved
Curse link
Individual Signs
Downloads
13,570
Recent files

Authors

Relationships

Required dependency
ProtocolLib