Making a Bukkit Player execute a Bungee Command.

Discussion in 'Spigot Plugin Development' started by NaJated, May 11, 2016.

  1. Hey all,

    How would I make a Bukkit Player execute a Bungee Command, forcefully?

    Thanks!
     
  2. The same way you make them use any command.

    Code (Text):
    player.runCommand("server Factions");
     
    • Funny Funny x 2
    • Winner Winner x 1
    • Optimistic Optimistic x 1
    • Creative Creative x 1
  3. http://prntscr.com/b2urke
     
    • Like Like x 1
  4. he's talking about proxy commands.
    If you want an easy way to make players run proxy commands from bukkit, send them a JSON message with a clickevent that makes them run the command
     
    • Agree Agree x 1
  5. Do you think you could give us an example. Really dont wanna look for json stuff
     
  6. https://www.spigotmc.org/wiki/the-chat-component-api/
    It's mainly part of the bungee api but also included in spigot, just use player.spigot().sendMessage(...) instead of player.sendMessage(...) after you made your component
     
    • Agree Agree x 1
  7. I want to execute commands not send messages lol
     
  8. That's why you
    Bungee commands have to be sent by the client.
     
    • Like Like x 1
  9. Use plugin messages to contact to bungeecord from bukkit, I don't think it's possible to force the player to run a command, and dispatching a command from bukkit will do nothing, bungeecord commands are not visible to bukkit.
     
    • Agree Agree x 3
    • Informative Informative x 1
  10. You can't. What BungeeCord command needs to be ran that you can't do with the messaging channel?
     
    • Agree Agree x 1
  11. Bungeecord command to store cross server data.
     
  12. You have a plugin on the bungeecord side, right? Just implement a listener in the bungeecord side and a sender in the bukkit side.
     
  13. How do I do that.. ?
     
  14. With a bungeecord plugin
     
  15. Yes but theres no messaging channel like "command", as such.
     
  16. Register your PluginMessage channel on the bukkit side, register a PluginMessageEvent on the bungee side and send whatever data needs to be send over it!

    FAQ:
    Q: What bungee side?
    A: Your bungeecoord plugin used to coordinate things
    Q: I dont have a bungee plugin?!
    A: Make one!
     
    • Agree Agree x 2
  17. That would probably not work. As the perform method is for Bukkit Commands, not Bungee.
     
    • Agree Agree x 1