Plugin: NamedSigns

Let’s put a couple of these ideas together and make a plugin that uses helper functions (with and without return values), private functions and variables, some low-level array access, and a hash that will store names and locations.

This plugin lets you create signposts in the game and name them. You can then put text on any one of the signposts by name. For example, suppose I make two signs, named one and two, by typing these commands in the chat window:

 
/signs new one
 
/signs new two
 
/signs set one Hello!
 
/signs set two Goodbye!

I’d see something like this:

images/NamedSigns.png

Now I can go in and change either sign’s text at will just ...

Get Learn to Program with Minecraft Plugins, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.