LinkMe - Share Links & Info with Players via simple Commands

This is a discussion topic for the Ore project, LinkMe. View the full project on Ore for downloads and more information.


LinkMe - Share Links & Info with Players via simple Commands!

The Idea

The general premise behind LinkMe is simple: when running a server, you often have links you want to share with your players (website, forums, etc.). However, there may be too many to embed in the motd, so you’ll inevitably have players asking “What is the link to x resource?” That’s where LinkMe steps in! LinkMe will allow you to create commands, /forum for example, that will send them a link to the appropriate site. LinkMe can also be used to send simple messages to the player, such as rules, help messages, etc.

Creating Links

Edit the linkme.conf file located at ~/config/linkme.conf it should look something like the following:

links {
  Hello = "Hello World!"
  Link = "https://www.spongepowered.org"
  Formatted = "&9I'm Blue"
}

The format of links are <Link Name> = <Link Message>
Important: If you want links in your messages to be clickable they must start with either http:// or https://

To use a link, players will simply execute /<Link Name> in chat and they will receive the link message.
Important: All link commands will be assigned a permission node with the value linkme.commands.<lowercase link name> where <lowercase link name> is the name of the link in all lowercase letters! This will allow you to control which links are available to each player.

Advanced Mode - HOCON Links

For those of you with configuration ninja skills links can also be specified in HOCON Configuration Format. For example:

links {
  HoconLinkExample {
    clickEvent {
      action = "open_url"
      value = "https://www.spongepowered.org"
    }
    color = yellow
    text = Sponge
    underlined = true
  }
}

This would create a link with the name HoconLinkExample which would display Sponge underlined, in yellow, and would link to the Sponge homepage.

Support Me

I will never charge money for the use of my plugins, however they do require a significant amount of work to maintain and update. If you’d like to show your support and buy me a cup of tea sometime (I don’t drink that horrid coffee stuff :P) you can do so here

2 Likes

How do I add a second link with maybe a new command? Im confised

You simply add another entry in the Links field. Let’s say you wanted to add a link called Rules, when the user types /rules you want them to get the message “Don’t grief other player’s land”, then inside Links {} add a new line in the form Rules = "Don't grief other player's land", for advanced links add a new line in the from <Link Name> {<HOCON Stuff>}, make sense?

Im confused still haha, could you create an example of adding a second (with original) that would say direct you to a website?

In this example we add a new link which can be accessed by the command /MyNewLinkcommand which has an open_url action which will open the webpage https://www.mywebsite.com, in chat the link will be displayed as “Mywebsite” in blue underlined text. Make sense?

links {
  HoconLinkExample {
    clickEvent {
      action = "open_url"
      value = "https://www.spongepowered.org"
    }
    color = yellow
    text = Sponge
    underlined = true
  }
  MyNewLinkCommand {
    clickEvent {
      action = "open_url"
      value = "https://www.mywebsite.com"
    }
    color = blue
    text = Mywebsite
    underlined = true
  }
}

Having an issue when using a very large number of basic commands, capitalization in the name of the command makes or breaks it. (in the config)

I can’t seem to find any pattern in how they need to be capitalized in order to work properly. This only happens with many commands, (I have somewhere around 500) if I remove most of them the capitalization doesn’t matter anymore. In addition, I’ve come across one that can’t be fixed by changing the capitalization. Any thoughts?

Are there any errors that are thrown? Capitalization shouldn’t matter, you could try making them all lowercase and seeing if that fixes it?

1 Like

I started with them all lowercase, and some didn’t work. I tried to find any syntax issue for about an hour before trying to capitalize one of the commands that did not work, which caused it to function after rebooting the server.

Heres an example of two commands next to each-other that don’t make sense. When I have all of the commands loaded, these are config lines 324 and 326 respectively. (1041 lines total) When everything is loaded, the umbreon command does not work. However, if I name it Umbreon and restart then it works. It also works if I remove all other commands besides espeon and umbreon, without capitalization. I have always left the example hocon command and hello at the start of the file untouched if that helps. Thank you for your timely and supportive reply.

	espeon="- &2&m==================================\n - &aName: &6Espeon\n - &aEvolves: &6None\n - &aType: &6Psychic\n - &aBiome: &6None\n - &aSpawn Time: &6None\n - &aAbilities: &6Synchronize\n - &aHidden Ability: &6Magic Bounce\n - &aEV Yield: &62 Special Attack\n - &aEgg Groups: &6Field\n - &aDrops: &6Ender Pearl\n - &aWeak Against: &6Bug, Dark, Ghost\n - &aResistant To: &6Fighting, Psychic\n - &aNot Affected By: &6None\n- &2&m=================================="
	 
	umbreon="- &2&m==================================\n - &aName: &6Umbreon\n - &aEvolves: &6None\n - &aType: &6Dark\n - &aBiome: &6None\n - &aSpawn Time: &6None\n - &aAbilities: &6Synchronize\n - &aHidden Ability: &6Inner Focus\n - &aEV Yield: &62 Special Defense\n - &aEgg Groups: &6Field\n - &aDrops: &6None\n - &aWeak Against: &6Bug, Fairy, Fighting\n - &aResistant To: &6Dark, Ghost\n - &aNot Affected By: &6Psychic\n- &2&m=================================="

Here are all lines containing linkme in the server’s fml

My full list of mods/plugins is:
BetterFPS-1.3.2
CraftBook-4.0-SNAPSHOT
LinkMe-v1.1.0
LuckPerms-Sponge-3.0.71
NBTEdit-1.10.2-2.0.0
Pixelmon-1.10.2-5.0.3-universal
spongeforge-1.10.2-2254-5.2.0-BETA-2234
worldedit-sponge-mc1.10.2-6.1.5-SNAPSHOT-dist

On a Windows 7 machine using Java 1.8.0_73-b02

Edit: Thanks for Zerthick’s great assistance, it turned out to be a silly mistake on my part involving duplicate entries.

Can you give me a pastebin of your config file? Baring that, I don’t think it should matter but trying inserting spaces around the = sign so espeon="my message" becomes espeon = "my message" You should also be able to delete the example messages in the file, they aren’t needed.

Can i make a clickable link with the https:// <-- when it tries to open my enjinn site (https://www.FishSticksMc.com ) it doesn’t work because of that.

Https should be supported, the examples I list use it in fact. When I attempt to connect to your site I get an insecure connection warning though, perhaps that’s why it isn’t working?

that link doesn’t work with the https:// <–

I’m confused what the issue is. When I attempt to connect to your link using a browser I’m getting an insecure connection warning. This has nothing to do with my plugin, it appears that your website is not configured properly to support an https connection.

https://www.FishSticksMc.com ← this one doesn’t work
www.FishSticksMc.com ← this one does work

links dont work unless you add the https :octopus:

Did you try http://www.FishSticksMc.com?

this is so confusing D: sorry haha i derpped i guess

No worries, I’ll just quote the relevant part of the main post here :stuck_out_tongue:

Can you see anything wrong with this

If the text you want to display contains spaces you need to encase it in quotes, so text = Fish Sticks MC Website would become text = "Fish Sticks MC Website" and so on.

A new version has been released for LinkMe, it is available for download here.


Six Support!

Release v1.2.0

Minecraft 1.11.2 - Tested on spongeforge-1.11.2-2282-6.0.0-BETA-2297

Changes:

  • Updated to Sponge API 6.0

Enjoy!