Broadcasts
Sending prize announcements to chat exactly as you wrote them, without another plugin's prefix.
A reward can announce itself. Put a broadcast command in a reward and everyone hears about the win.
rewards:
last-hit:
'1':
chance: 50.0
commands:
- "eco give %player% 1000"
- "broadcast &6%player% &elanded the final hit!"The prefix problem
Normally that broadcast command is handed to whichever plugin owns it, usually EssentialsX, which puts its own [Broadcast] label on the front. Your carefully written line ends up buried behind someone else's branding.
The plugin can send the message to chat itself instead.
broadcast:
handle-internally: true
commands:
- broadcast
- bcast
- bc
- shout
prefix: ""| Key | What it does | Default |
|---|---|---|
handle-internally | true sends the message through the plugin, with nothing added. false hands the command over as normal. | true |
commands | Which command names count as a broadcast. | broadcast, bcast, bc, shout |
prefix | Text put in front of every message the plugin sends this way. | empty |
How the matching works
The plugin looks at the first word of a reward command.
- Capitalisation is ignored, so
Broadcastmatches. - A plugin namespace is stripped, so
essentials:broadcastmatches thebroadcastentry. - Everything after that first word is the message.
Anything not in the list runs as a normal console command, exactly as it would have before.
Remove an entry from commands to hand that one back to its own plugin. Take bc out of the list and bc hello goes to EssentialsX again, while broadcast hello still comes from the plugin.
Adding your own prefix
broadcast:
prefix: "%prefix% "%prefix% pulls in the prefix value from your language file, so broadcasts match the rest of the plugin's messages. Or write something else entirely:
broadcast:
prefix: "<gradient:#ffaa00:#ff5555>&lWINNER &r"Color codes, hex and gradients all work. See Colors and formatting.
Worked example
broadcast:
handle-internally: true
prefix: "%prefix% "
rewards:
last-hit:
min-rewards: 1
max-rewards: 1
'1':
chance: 100.0
commands:
- "broadcast &e%player% &asmashed the pinata and took the jackpot!"Everyone sees the plugin's own prefix followed by your line, with no [Broadcast] in sight.
Because the plugin sends the text itself, any per player permission or ignore handling from your chat plugin does not apply. Everyone online sees it.