AT-PinataParty

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.

config.yml
rewards:
  last-hit:
    '1':
      chance: 50.0
      commands:
        - "eco give %player% 1000"
        - "broadcast &6%player% &elanded the final hit!"

The prefix problem

The same reward command shown both ways. Handed to another plugin it arrives with a Broadcast label in front, sent by the plugin it arrives exactly as written

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.

config.yml
broadcast:
  handle-internally: true
  commands:
    - broadcast
    - bcast
    - bc
    - shout
  prefix: ""
KeyWhat it doesDefault
handle-internallytrue sends the message through the plugin, with nothing added. false hands the command over as normal.true
commandsWhich command names count as a broadcast.broadcast, bcast, bc, shout
prefixText 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 Broadcast matches.
  • A plugin namespace is stripped, so essentials:broadcast matches the broadcast entry.
  • 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

config.yml
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

config.yml
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.

On this page