John-Paul-R / Essential-Commands

Configurable, permissions-backed utility commands for Fabric servers (tpa, home, warp, spawn, back, nick, rtp)
MIT License
109 stars 35 forks source link

Enhancement: /broadcast #189

Open jiriks74 opened 1 year ago

jiriks74 commented 1 year ago

Add a command to broadcast messages to all players as if sent from server console.

John-Paul-R commented 1 year ago

Isn't this what /tellraw does?

jiriks74 commented 1 year ago

Isn't this what /tellraw does?

Well, it can do what I want but it requires json syntax. It really isn't suited for quickly sending a server message. The only way to use /tellraw, at least for me, it to use something like this to generate the messages for me.

I think that just quickly sending something with just /broadcast <message> is way easier than /tellraw @a {"text":"<message>"}.

John-Paul-R commented 1 year ago

Ah, I understand, that's fair.

I'd frankly recommend just tossing together a shortcut with Command Aliases for something like this. example, for broadcast:

schemaVersion = 1 # Required | Schema Version
commandMode = "COMMAND_CUSTOM" # Required | Custom Command Format
command = "broadcast" # Required | Parent command name
permission = 4 # Optional | Default: 0 | If LuckPerms is not installed will fallback to these permission level

[[children]] # Optional | List of sub-child commands

child = "message_body"
type = "argument"
argumentType = "minecraft:greedy_string"

[[children.actions]] # Optional | List of actions

command = "tellraw @a {\"text\": \"[Server] {{message_body}}\"}" # Optional | Command to execute will be processed to map variables and process functions
commandType = "SERVER" # Optional | Required if command is present
message = "Broadcasted message." # Optional | Executor gets a local message

output:

broadcast-commandaliases-demo

John-Paul-R commented 1 year ago

(that would go in config/commandaliases/broadcast.tomlonce installed)

jiriks74 commented 1 year ago

Works, thanks <3 I still think it would be a great addition though. Feel free to mark this as resolved if you want. Great work btw!

John-Paul-R commented 1 year ago

Yeah, I don't entirely disagree. I'll leave this open and rainy-day project it.