Skript icon indicating copy to clipboard operation
Skript copied to clipboard

Add server broadcast event

Open TheLimeGlass opened this issue 2 years ago • 6 comments

Description

Add server broadcast event


Target Minecraft Versions: none Requirements: none Related Issues: https://github.com/SkriptLang/Skript/issues/1385 (closing as complete), https://github.com/SkriptLang/Skript/issues/4185 (non-closing)

TheLimeGlass avatar Apr 19 '23 03:04 TheLimeGlass

Apart from built-in advertisements like Serverpro which will trigger this event, there’s no other way that this event will be triggered within the Skript environment as EffBroadcast does not use Server#broadcast(java.lang.String,java.lang.String), as shown here.

NotSoDelayed avatar Apr 19 '23 04:04 NotSoDelayed

Apart from built-in advertisements like Serverpro which will trigger this event, there’s no other way that this event will be triggered within the Skript environment as EffBroadcast does not use Server#broadcast(java.lang.String,java.lang.String), as shown here.

I wonder why Skript doesn't use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Server.html#broadcastMessage(java.lang.String) here?

AyhamAl-Ali avatar Apr 19 '23 10:04 AyhamAl-Ali

Apart from built-in advertisements like Serverpro which will trigger this event, there’s no other way that this event will be triggered within the Skript environment as EffBroadcast does not use Server#broadcast(java.lang.String,java.lang.String), as shown here.

I wonder why Skript doesn't use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Server.html#broadcastMessage(java.lang.String) here?

Likely because EffBroadcast also supports sending broadcasts to a specific world, which means special handling would be required to use broadcastMessage (and at the time it was added there was probably no incentive to do so, as sending the messages to each sender individually achieved the same effect)

bluelhf avatar Apr 19 '23 12:04 bluelhf

Apart from built-in advertisements like Serverpro which will trigger this event, there’s no other way that this event will be triggered within the Skript environment as EffBroadcast does not use Server#broadcast(java.lang.String,java.lang.String), as shown here.

I wonder why Skript doesn't use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Server.html#broadcastMessage(java.lang.String) here?

Likely because EffBroadcast also supports sending broadcasts to a specific world, which means special handling would be required to use broadcastMessage (and at the time it was added there was probably no incentive to do so, as sending the messages to each sender individually achieved the same effect)

EffBroadcast could call the event manually. it would have to strip the formatting for the event, but thats probably fine.

Pikachu920 avatar Apr 19 '23 17:04 Pikachu920

EffBroadcast could use Server#broadcast as it supports components now.

TheLimeGlass avatar Apr 19 '23 22:04 TheLimeGlass

EffBroadcast could use Server#broadcast as it supports components now.

That doesn't work for specific worlds, though, which would mean we'd still need to trigger the event manually. Maybe we'd be better off just calling the event manually in any case?

bluelhf avatar Apr 20 '23 07:04 bluelhf

Inactive

sovdeeth avatar May 06 '25 21:05 sovdeeth