This API allows you to to create dynamic messages, load messages from configuration files and format the messages you created.
Examples
Add messages
new MessageBuilder ( )
. withMessage ( "test.message1", "This is the first test message" )
. withMessage ( "test.another.message", "This is another test message" )
. build ( ) ;
Load additional messages from the plugin's configuration file
new MessageBuilder ( )
. withMessage ( "test.message1", "This is the first test message" )
. withMessage ( "test.another.message", "This is another test message" )
. fromConfig (myPlugin. getConfig ( ) )
. build ( ) ;
Access built messages
MessageContainer container = new MessageBuilder ( )
. withMessage ( "test.message1", "This is the first test message" )
. withMessage ( "test.another.message", "This is another test message" )
. build ( ) ;
container. getMessage ( "test.message1" ) ; // Returns 'This is the first test message'
Access built messages with additional replacements
MessageContainer container = new MessageBuilder ( )
. withMessage ( "test.message1", "This is the first test message" )
. withMessage ( "test.another.message", "This is another test message" )
. withMessage ( "test.formatted.message", "This is a formatted message for %player%" )
. build ( ) ;
container. getMessage ( "test.formatted.message", new ReplacementContainer ( ). replace ( "%player%", player. getName ( ) ) ) ; //Returns (for example) 'This is a formatted message for inventivetalent'
Maven
<repositories>
<repository>
<id>inventive-repo </id>
<url>https://repo.inventivetalent.org/content/groups/public/ </url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.inventivetalent </groupId>
<artifactId>messagebuilder </artifactId>
<version>1.0.0 </version>
</dependency>
</dependencies>
Links
Examples
Add messages
Code (Java):
new MessageBuilder ( )
. withMessage ( "test.message1", "This is the first test message" )
. withMessage ( "test.another.message", "This is another test message" )
. build ( ) ;
Code (Java):
new MessageBuilder ( )
. withMessage ( "test.message1", "This is the first test message" )
. withMessage ( "test.another.message", "This is another test message" )
. fromConfig (myPlugin. getConfig ( ) )
. build ( ) ;
Code (Java):
MessageContainer container = new MessageBuilder ( )
. withMessage ( "test.message1", "This is the first test message" )
. withMessage ( "test.another.message", "This is another test message" )
. build ( ) ;
container. getMessage ( "test.message1" ) ; // Returns 'This is the first test message'
Code (Java):
MessageContainer container = new MessageBuilder ( )
. withMessage ( "test.message1", "This is the first test message" )
. withMessage ( "test.another.message", "This is another test message" )
. withMessage ( "test.formatted.message", "This is a formatted message for %player%" )
. build ( ) ;
container. getMessage ( "test.formatted.message", new ReplacementContainer ( ). replace ( "%player%", player. getName ( ) ) ) ; //Returns (for example) 'This is a formatted message for inventivetalent'
Maven
Code (XML):
<repositories>
<repository>
<id>inventive-repo </id>
<url>https://repo.inventivetalent.org/content/groups/public/ </url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.inventivetalent </groupId>
<artifactId>messagebuilder </artifactId>
<version>1.0.0 </version>
</dependency>
</dependencies>
Links
Quick facts
- Edition: Minecraft Java
- File type: .jar
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
[API] MessageBuilder is a free Minecraft Java mod. Downloaded 432 times (via Spigot). Download it and open it directly in the game.
Related Java mods
M
MessageBuilder
M
26.1
message-api
[
[API] MenuBuilder
1.8
MyCloneBuilder API
[
1.7
[API] RecipeBuilder
[
1.7
![[IMG]](http://proxy.spigotmc.org/03b89c2282b33ef720a7e5ca8cfbbb31681bc8b8?url=https%3A%2F%2Fstatic.spigotmc.org%2Fimg%2Fbtn_donate.gif)