Compatibility
Minecraft: Java Edition
Platforms
75% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+Creators
Details
StrippedBroadcast is a recreation of the Plugin RawMsg.
The main purpose of the Plugin is to send a message in chat just like the command broadcast. However, when sent, the message will not dispose of a prefix and the sender can specify a group of players to send the message to. It also has an API available for any developer to be used.
Commands
The main and only command of StrippedBroadcast is, you guessed it, /sbc (short for /simplebroadcast). Its syntax is:
/sbc <targets> <message>
​
As explained by the Plugin itself when trying to execute the command, the first argument should represent the targets of the broadcast. These could be:
- all, for every player online on the server;
- <player> or player=<player>, the only user who will see the message;
- me, an alias for the command issuer;
- world=<world>, for every player present in that world; perm=<permission>, for any player who has the permission;
- op or perm=op, for every op player in the server;
- group=<group>; StrippedBroadcast is compatible with LuckPerms, so the argument "group" will allow the user to specify a certain group of players;
- item=<item>; for every player who has that item in the server;
- effect=<effect>; for every player who the specified effect;
- gamemode=<gamemode>; for every player in that gamemode;
- money=<money>; for every player that has that amount of money.
Expressions
StrippedBroadcast is also able to understand expressions as target. The user will be able to specify certain conditions that will return a list of compatible players.
Every expression should be expressed in parenthesis, but there is possibility to put more parenthesis inside one.
Example:
/sbc (world=world_the_nether && (perm=bukkit.* || perm=minecraft.*)) Looks like you are the king of hell!
​
You will also notice that expressions accept the keywords AND (&&) and OR (||). Their functioning is really simple:
- in the above example, the OR keyword is used to get every player who has the permission "bukkit.*" or the permission "minecraft.*";
- the AND keyword is then used to get every player who is in the nether and has one of the two permissions.
Also, the plugin uses Tab Completition, so it will be very helpful at remembering the user to close parenthesis or insert certain keywords.
Permissions
The only permission for StrippedBroadcast is "sbc.main", which will allow the user to execute the /sbc command.
Colors
Since the Minecraft 1.16 update, Hex Colors were added to the game. Now, StrippedBroadcast is able not only to use the default Minecraft colors ("&"), but also custom ones using the character #. If you are on 1.16 or higher, when typing "#", the plugin will suggest all the valid letters and numbers to be used as color codes. Also, there is a new rainbow effect available. To use it, just type [RAINBOW] in front of your message. Example:
/sbc all [RAINBOW] StrippedBroadcast v1.2 is an amazing plugin!
BungeeCord
Recently a version of StrippedBroadcast compatible with BungeeCord was released. It uses the same functionalities as the Spigot one, however some argument do change:
- all, for every player online in the server;
- a player, the only user who will see the message;
- a server ("server=<server>"), for every player present in that server;
- a permission ("perm=<permission>"), for any player who has the permission;
- a group ("group=<group>"), for any player who is in that group (REQUIRES LUCKPERMS).
An API is available also for BungeeCord, that uses the same names as the Spigot API followed by a "B" (e.g. PlayerUtilsB is the PlayerUtils for the BungeeCord part of the Plugin). The Main Class is accessible by the name StrippedBroadcastBungee and it contains all of the methods to send a message to a list of players.
API
I honestly have no idea of how this Plugin API could be implemented, but I'm very curious to see what the developers will be able to create. Anyway, after importing the Plugin into your project, you are ready to begin. Two classes will be of your interest:
StrippedBroadcast
The class StrippedBroadcast contains the static method sendStrippedBroadcast. This will send the given message (it can be a string, a list of strings or even an array) to the list of players specified. An example is:
String[] strings = new String[]{"This", "is", "a", "cool", "message"};
StrippedBroadcastEvent.sendStrippedBroadcast(Bukkit.getOnlinePlayers(), strings);
StrippedBroadcastEvent and StrippedBroadcastEventB
The StrippedBroadcastEvent and StrippedBroadcastEventB are events called anytime a message is sent using the Plugin Command or the Methods. They contain two variables: a list of involved players and the message sent.
@EventHandler
public void onMessageSent(StrippedBroadcastEvent event) {
event.getMessage();
}
@EventHandler
public void onBungeeMessageSent(StrippedBroadcastEventB event) {
event.getMessage();
}
PlayersUtil
The PlayersUtil class contains all the methods that can be used to get list of players using certain input. Just like the /sbc command, PlayersUtil supports any kind of input value, from a world, to a permission, a gamemode, a player name and so on... To get a more accurate list of all the available methods, you can check the GitHub page. https://github.com/Fulminazzo/StrippedBroadcast