Search code examples
javaautomationcommandminecraft

How to see and send commands to minecraft server without typing them


I have a tlauncher (cracked Mincraft) player, and I play on cracked minecraft servers.

I put a request here is because what I want to do is, to earn money players sell blaze rods by click on the gui which is opened when we type /shop command.

Now what I want is to get the line of code which my tlauncher player sends to the server when I click on the sell blaze rod button, and then I want to send that command to server without opening the GUI.

So what I want to know is "what is going on the backend". I have no idea of what to do here. I am a python developer but I have a basic Idea of java, I don't know anything in minecraft java development.


Solution

  • You question seems too board. I suggest you multiple things :

    1. Search a mod that have a config to run a command when you say something in chat. Possible to don't find something.

    2. Create your own version of minecraft such as suggested here. Require lot of Java skill

    3. Use forge, and just make a mod. You can follow tutorial like this one. Require some Java Skill

    You should listen for event, in your case it seems to be ClientChatReceivedEvent. Then, run this code:

    MinecraftServer.getServer().getCommandManager().executeCommand(player, "shop")
    
    1. Use fabric, and add all features that you want. You can follow tutorial like this one. Require some Java Skill

    To listen events, you should take a look here.