Home›Java›Mods›SpigotMessageAPI
SpigotMessageAPI
ModsJava

SpigotMessageAPI

Minecraft Java mod. Downloads from the MC Java Mods app on Android.

⬇ Download on Spigot
SpigotMessageAPI.png

Please report any bugs you found here.
Sounds are different for 1.8/1.10! (Download Sounds 1.8) (Download Sounds 1.10)

rsz_github.jpg ​
Features.jpg

Spoiler: How To: Messages
Players will be able to configure their messages like explained below. You can use multiple options (for example, you are able to send a regular message and an actionbar!) This is the format of these messages, an example usage will be given below.

Code (format (Unknown Language)):
<config-path>:
  Message: '<message>'
  MessageList:
  - '<message1>'
  - '<message2>'
  Title:
    FadeIn: <fade in time>
    Stay: <stay time>
    FadeOut: <fade out time>
    Title: '<message>'
    Subtitle: '<message>'
  ActionBar:
    Stay: <stay time>
    ActionBar: '<message>'
  Sound: <sound>
The format will change when a specific load type is used. It will replace the "Message", "MessageList", "Title", "ActionBar" and "Sound" with the config path:

Code (format (Unknown Language)):

<config-path>: '<message>'
<config-path>:
  - '<message1>'
  - '<message2>'
<config-path>:
  FadeIn: <fade in time>
  Stay: <stay time>
  FadeOut: <fade out time>
  Title: '<message>'
  Subtitle: '<message>'
<config-path>:
  Stay: <stay time>
  ActionBar: '<message>'
<config-path>: <sound>
Regular Message:
Code (regularmessage (Unknown Language)):
ToReceiver:
  Message: '&7[%server-sender%&7] &6%suggest-player% &7> &7[%server-receiver%&7] &6%receiver%&7: &6%msg%'
Multiple Messages:
Code (multiplemessages (Unknown Language)):
ToReceiver:
  MessageList:
  - '&7[%server-sender%&7] &6%suggest-player% &7sent you a message:
  - '&6%msg%'
Title:
Code (title (Unknown Language)):
ToReceiver:
  Title:
    FadeIn: 2
    Stay: 10
    FadeOut: 2
    Title: '&7%sender%'
    Subtitle: '&6%msg%'
ActionBar:
Code (actionbar (Unknown Language)):
ToReceiver:
  ActionBar:
    Stay: 10
    ActionBar: '&6%sender%&7: &6%msg%'
Sound:
Code (sound (Unknown Language)):
ToReceiver:
  Sound: <sound>
Spoiler: How To: Use SpigotMessagesAPI
There are several things you'll have to do in order to use SpigotMessagesAPI. (Players will also have to install this plugin on their server)

Step 1:
Set " depends: [SpigotMessagesAPI]" in your plugin.yml

Step 2:
Import SpigotMessagesAPI to your project, different for each software you use. This option will most likely be called "library".

Step 3:
Register one of your config files.
Code (Text):
SpigotMessageAPI.registerConfigFile(<name>, new ConfigFile(<directory>, <file name>));
Here is an example usage:
Code (Text):
ConfigFile configFile = new ConfigFile(getDataFolder().getPath(), "config.yml");
SpigotMessageAPI.registerConfigFile("config", configFile);
Step 4:
Register messages:
Code (Text):
SpigotMessageAPI.registerMessage(<name>, new Message(<config file>, <path>));
You can also put a load type in that method, that way it will only load that method:
Code (Text):
SpigotMessageAPI.registerMessage(<name>, new Message(<config file>, <path>, LoadType.TITLE));
Here is an example usage:
Code (Text):
SpigotMessageAPI.registerMessage("msg", new Message(configFile, "Messages.MSG"));
Step 5:
Use the plugin. Here are a few methods that you'll be able to use with SpigotMessageAPI.

Code (Text):
//Getter for config file
ConfigFile configFile = SpigotMessageAPI.getConfigFile(String name)
//Reload config file (with all messages setup for it)
configFile.reload();

//Getter for message
Message message = SpigotMessageAPI.getMessage(String name)
//Get message parser, to replace variables etc.
MessageParser mP = message.getParser();
//Replace variables
mP.parseVariable(String variable, String replacement)
//Send message
mP.send(CommandSender sender);
//Send message as long as it doesn't contain x, y, z... (Will be done per line if a list, the same for title and subtitle)
mP.send(CommandSender sender, String... cannotContain);
 

If you found any sorts of bugs or do you have any suggestions, please, put them in the comments so I'll be able to make this plugin better!​

If you want to support my projects with a donation:
[​IMG]
​
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

SpigotMessageAPI is a free Minecraft Java mod. Downloaded 285 times (via Spigot). Download it and open it directly in the game.

Explore more