CommandForward icon indicating copy to clipboard operation
CommandForward copied to clipboard

add console@<player name>, which allows routing a console command via a specific player

Open quiquelhappy opened this issue 1 year ago • 4 comments

Problem:

In certain scenarios, NPCs are treated as players on the server. When using the current /forward console command, the system selects a random player connection to forward the command. However, this can sometimes select an NPC or bot, which might not have a valid BungeeCord connection, leading to failed message routing.

Solution:

By adding the ability to specify a player directly using console@<player_name>, users can ensure that the console command is forwarded via a valid, real player’s connection, avoiding the risk of selecting an invalid NPC or bot connection.

Updated SpigotMC section:

(on the Using It list):

  • Example Execute as Console (using a specific player connection): /forward console@playerName ping bridgePlayer is the player which connection should be used, but it will be executed as bungee console there.

quiquelhappy avatar Sep 25 '24 09:09 quiquelhappy

now testing it. compiled jar: CommandForward.zip

quiquelhappy avatar Sep 25 '24 09:09 quiquelhappy

I tested it, and it is working correctly

https://github.com/user-attachments/assets/a0c06af1-2590-41f0-ba4e-c7d48c45b641

quiquelhappy avatar Sep 25 '24 14:09 quiquelhappy

I feel like this complicates the command usage a lot. Maybe we should rather detect the NPC status. Doesn't some NPC plugins set a metadata flag, we could use?

TuxCoding avatar Oct 30 '24 09:10 TuxCoding

I feel like this complicates the command usage a lot. Maybe we should rather detect the NPC status. Doesn't some NPC plugins set a metadata flag, we could use?

not really (not for all plugins), either way, it adds flexibility to the command, routing console via an specific player could be very handy on other scenarios we might not be thinking about right now. its optional anyways, could be documented as something minor or as a note on the current console cmd

quiquelhappy avatar Oct 30 '24 11:10 quiquelhappy