https://github.com/fulminazzo/strippedbroadcast
A simple plugin that will display a formatted message in chat for the specified users.
https://github.com/fulminazzo/strippedbroadcast
bukkit bungeecord bungeecord-plugin minecraft minecraft-plugin plugin spigot spigot-plugin
Last synced: about 2 months ago
JSON representation
A simple plugin that will display a formatted message in chat for the specified users.
- Host: GitHub
- URL: https://github.com/fulminazzo/strippedbroadcast
- Owner: fulminazzo
- Created: 2021-07-31T21:45:18.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-06-11T23:24:34.000Z (about 3 years ago)
- Last Synced: 2025-06-24T13:54:28.811Z (12 months ago)
- Topics: bukkit, bungeecord, bungeecord-plugin, minecraft, minecraft-plugin, plugin, spigot, spigot-plugin
- Language: Java
- Homepage:
- Size: 77.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# StrippedBroadcast
StrippedBroadcast is a recreation of the Plugin RawMsg (https://www.spigotmc.org/resources/rawmsg.35864/).
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. (Explained in the Command Section.)
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:
- /strippedbroadcast <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 in the server
- a player, the only user who will see the message
- a world ("world=<world>"), for every player present in that world
- 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 item ("item=<item>"), for any player who have that item in their inventory
- an effect ("effect=<effect>"), for any player who have that effect active
- a gamemode ("gamemode=<gamemode>"), for any player who is in that gamemode
- a number ("money=<money>"), for any player that have that quantity in their balance (REQUIRES VAULT)
## 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![/code]
```
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. Three classes will be of your interest:
### StrippedBroadcast
The StrippedBroadcast class 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:
```java
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.
```java
@EventHandler
public void onMessageSent(StrippedBroadcastEvent event) {
event.getMessage();
}
```
```java
@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:
`getAllPlayers()` returns a list containing all Online Players.
`getUserPlayer(CommandSender sender)` returns a list containing the sender of the command (if it is console, il will be null).
`getPlayerFromName(String playerName)` returns a list containing the Player with the name "playerName".
`getPlayersFromWorld(String worldName)` returns a list containing all the players in the world "worldName".
`getPlayersFromPermission(String permission)` returns a list containing all the players with the permission "permission".
`getOPPlayers()` returns a list containing all the operator players.
`getPlayersFromGroup(String groupName)` returns a list containing all the players in the LuckPerms group "groupName".
`getPlayersFromEffect(String effectName, String level)` returns a list containing all the players with effect "effectName" of level "level".
`getPlayersFromItem(String itemName, String amount)` returns a list containing all the players that have the item "itemName" of amount "amount" in their inventory.
`getPlayersFromGameMode(String gameModeString)` returns a list containing all the players in gamemode "gameModeString".
`getPlayersFromMoney(String money)` returns a list containing all the players that have "money" Vault balance.
Also, every method is associated with submethods for each parameter. For example:
`getPlayersFromEffect(String effectName, String level)`
can be used as:
`getPlayersFromEffect(String effectName)` (returns a list of all the players with effect "effectName", despite of the level)
`getPlayersFromEffect(String effectName, int level)`
`getPlayersFromEffect(PotionEffectType effect, int level)`
`getPlayersFromEffect(PotionEffectType effect)`
### PlayersUtilB
Just like PlayersUtil, also the BungeeCord part of the plugin has a PlayersUtilB that contains all the methods to access a list of players based on a certain input. This supports:
`getAllPlayers()` returns a list containing all Online Players.
`getUserPlayer(CommandSender sender)` returns a list containing the sender of the command (if it is console, il will be null).
`getPlayerFromName(String playerName)` returns a list containing the Player with the name "playerName".
`getPlayersFromServer(String serverdName)` returns a list containing all the players in the server "serverName".
`getPlayersFromPermission(String permission)` returns a list containing all the players with the permission "permission".
`getPlayersFromGroup(String groupName)` returns a list containing all the players in the LuckPerms group "groupName".