1.14.4 Problems with Buycraft's /buy command

Discussion in 'Spigot Plugin Development' started by PartyMC, Mar 14, 2020.

  1. For one of my plugins I want a player when pressing on a certain thing in a GUI to get open the /buy menu from Buycraft. Here's my code (Excluding GUIs and stuff!):
    Code (Java):
    Bukkit.getServer().dispatchCommand(event.getWhoClicked(), "buy");
    I have 3 other commands being triggered using this technique, and those work fine. But when using /buy this way, I always get the error saying the command was not found. But doing /buy normally ingame does work. Does anyone know how to fix this?
     
  2. Try buycraft:buy (or whatever the name of the plugin is)
     
  3. That doesn't work, I think the problem comes from /buy not being a registered command, but it doing something when you type it.
     
  4. You could try Player#chat() but I’m not sure if that would work with commands.
     
  5. Or Player#performCommand()
     
  6. If Bukkit#dispatchCommand(CommandSender, String) does not work, Player#performCommand will also not work. Here is the implementation:
    Code (Java):
    @Override
    public boolean performCommand(String command) {
        return server.dispatchCommand(this, command);
    }
     
  7. This is still broke, and has no response. was there wany way to fix?
     
  8. drives_a_ford

    Moderator

    Use tebex instead.
    They are indeed doing some "magic" when it comes to the /buy command.
     
  9. Oof, that still doesnt work and just shows the admin commands
     
  10. drives_a_ford

    Moderator

    Just test the '/tebex' command with various arguments until you get the desired result. I'm fairly certain it's there.

    Or, you could use the BuyCraft plugin as a dependency and open their GUI within your code.
     
    • Like Like x 1