Individual Signs
Description
This plugin displays the text on signs for each player individual differently.
By default this plugin only replaces [PLAYER] on signs with the name and [DISPLAY] with the nick name of the player looking at it.
The permission nodes to create signs containing those tags are insigns.create.player and insigns.create.display.
However InSigns also includes an API for developers of other plugins to easily add own player-specific sign content.
This plugin could for example be used for individual greeting signs at your spawn. Your players will be amazed to see their own name on a sign!
IMPORTANT
This plugin needs ProtocolLib to work.
Make sure you have installed the right version of ProtocolLib.
This plugin should stay compatible with further versions of minecraft and bukkit as long as ProtocolLib doesn't have to change anything on it's API which InSigns is relying on, and the minecraft protocol isn't changing anything sign-related.
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 IndividualSigns 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 update the sign contents for a player.
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). The lines are in json format.
- setLine(int index, String line) - Sets the line of text at the specified index. Has to be in proper json format.
- isModified() - Whether or not this event was modified by some plugin.
- setCancelled(boolean cancelled) - If the event is cancelled the sign contents won't get updated for the affected player, leaving it at their current content (blank if all SignSendEvents get cancelled).
- 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 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) { return player.getName(); } }; getLogger().info("Plugin 'InSigns' found. Using it now."); } else { getLogger().info("Plugin 'InSigns' not found. Additional sign features disabled."); } } |
Plugins using InSigns
- Paintball War Edition - Offering individual paintball statistics signs.
- ScoreboardStats - Offering some individual general statistics signs.
Let me know if your plugin uses InSigns and you want to be mentioned here.
Statistics
This plugin uses bStats to collect anonymous usage statistics to determine the how many servers are using the plugin and with which minecraft versions it is used with the most. All collected information can be publicly viewed here: https://bstats.org/plugin/bukkit/InSigns
You can disable bStats for all plugins on your server by editing the file plugins/bStats/config.yml, or alternatively disable it only for IndividualSigns by setting 'metrics-stats' to 'false' inside InSigns' config.
Donations
If you like this plugin, consider supporting its development by making a donation.
Thanks in advance!
@Zombiebrine1
Insight? Help with what exactly? You could create a plugin request in the bukkit forums..
@blablubbabc
Could you offer any insight into where I could find help with this?
@Zombiebrine1
Displaying a values from the player's scoreboard? You would need someone who can write bukkit plugins.. Sadly I am currently to buisy with other things that I can't help you with that myself currently.
@blablubbabc
Speaking for him, where could we find somewhere I could find help with this?
@CaptainTc
Only if you write an addon which does that
Can you display peoples vanilla scoreboard values on signs with this plugin?
@antichip
Did you update your server software? If yes, on which version are you running? Maybe it's a broken spigot build..
Is ProtocolLib running and up to date? Are there any errors in the log?
Also, please create a ticket for this and keep me updated there.
I am using bungee and this now no longer is working, I used to rely on this for that added wow factor from players. no errors , just don't work.
@cookieman768
Yes it would be possible for me. However, I would prefer to have additional features seperate from this plugin in another plugin, because this is mainly meant as API.
If you read below I also already thought of creating such a plugin, however, I haven't yet found the time for that.
Would it be possible for you to tie this into vault and show how much money they have?
Ok that would be great :)
@LTCR
I think this is a good idea for another plugin, as this one is mainly the api. Maybe I will create something like this :)
You should add... [BALANCE] - Show your balance. Maybe hook it up with Iconomy? [ONLINE] - Show how many people are online. 10/25 [HELP] If you right click it pulls up the help list
Edit: [BALANCE] works with essentials if you turn it on.
@Ranetha
Make sure protocollib loaded successfully and that there are no other errors in your log. I will check when i am at home, but so far i see no reason beside a problem with protocollib that could explain this...
Edit: I just tested and it works fine on 1.5.2 as long as ProtocolLibs runs fine
1.5.2 error on load. Protocollib version 2.4.3.
@Bobacadodl
Ehh.. isn't this a vanilla minecraft "bug" ? I never thought this could be caused by my plugin.. :/ I will have to try this out later :P
Edit: Hm, as far as I understand, that is a client debug messages which is left inside minecraft (in the bukkit 1.4.5 R0.1 this is even listed as known caveat that can't be fixed by bukkit). However, it seems InSigns is causing somehow a situation that leads the minecraft client to display this message, as when breaking a sign withput InSigns is not displaying this message for me ..
Unfortunly, as I have no idea why the minecraft client decides to print this message I have no idea so far how to "fix" this on my side.. But I will keep my eyes open and hopefully will find something.. If you know more, let me know
Edit2: okay, thanks to lishid, the author of orebfuscator, I now know under which circumstances minecraft sends this message. There are 2 ways to fix it I can currently think of:
1.) not re-sending (updating) the sign for the player clicking on left-click
2.) scheduling 1 tick on each clicked sign and check if the sign is still there (if it wasn't a block break) and then re-send the signs content
Currently I prefer 1.) .. but this will mean that signs will not get updated anymore on left click, which is not that important for this plugin (but could be for plugins using it's api..)
So next update should fix this :P
This plugin is great! However, whenever I break a sign, it says "Unable to locate sign at [sign coordinates here]
Not sure if this is a bug, or intentional...
@comniemeer
Paintball isn't yet updated for InSign v1.2 . Try using v1.1 for now until I upload Paintbal v1.1.7
Hey, I get following error using version 1.2 (its a really huge stack trace):
http://pastebin.com/Wyt7ytzT
What could be the reason for this?
v1.3:
Thanks to Flemingjp98 for this suggestion!