add console@<player name>, which allows routing a console command via a specific player
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.
now testing it. compiled jar: CommandForward.zip
I tested it, and it is working correctly
https://github.com/user-attachments/assets/a0c06af1-2590-41f0-ba4e-c7d48c45b641
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?
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