#Is it possible to access a running Minecraft Client's source code or something?

42 messages · Page 1 of 1 (latest)

primal river
#

Anyone knows?

civic sirenBOT
#

This post has been reserved for your question.

Hey @primal river! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

soft violet
#

in what context?

#

do u just want to access the source code of minecraft or are u modding or something similar?

primal river
left cave
#

your question doesnt make much sense, but: You can "inject" into a running java instance (what minecraft runs on) and potentially modify classes, replace classes, etc. This includes downloading all classes currently loaded into the jvm, and decompiling them to view their "source" code (not exactly source, but the best java source representation of the compiled classes). See https://www.javaadvent.com/2019/12/a-beginners-guide-to-java-agents.html

While Java beginners quickly learn typing public static void main to run their applications, even seasoned developers often do not know about the JVM’s support of two additional entry points to a Java process: the premain and the agentmain methods. Both methods allow so-called Java agents to contribute to an existing Java program while residing ...

primal river
#

With only one attribution

left cave
#

i dont think we help with cheats

primal river
#

Not pretty much a cheat

#

No u got me wrong

#

I want to understand how those works

soft violet
#

so u just want to see minecraft source code?

#

if thats all u want to do u could set up a project with fabric and gradle/maven and just browse the minecraft-common and minecraft-clientonly sources

primal river
#

I want to understand how reach and some of the other things work

soft violet
#

alternatively u could use mcp

primal river
#

@soft violet do you know about agents

cursive mantle
primal river
#

My question is

#

Such as if we have a calculator program as a jar file and we want to change the "7" number to number "9" without editing its source code

#

How can we do that

#

And what i want to do is changing reach value of a client

knotty bone
#

well to do that then you will need a client you can well, "hack"

#

or in this case, control

#

it will probably need to connect to a server

#

like localhost:3000

#

it needs to send the values and retrieve them every frame most likely

#

NODE.JS has this sorta functionallity, with express and ejs

#

it can create localhost:3000 ports and has the .html capability. Just connect that with same java to read it (probably using a buffered reader or something different) and make it changeable through node js because the EJS can have values, just assign probably JSON which works with js because it is in the name. Just try to edi the values through the server and the client should see the changes

#

that is the only functiontallity

#

otherwise, you can just use a readable .txt file with a value like a number in this case 9, it will read it and put it somewhere (your choice). and make it update constantly whilst making it not lag your computer, it will read the files from a certain directory and since it is not part of the jar, it will read it like anyother file.

#

I have experienced this exact behaviour whilst running a python file that is not in a jar file

#

Basically, it is very confusing by also very possible

#

if you want, I can create a github repos for this exact behaviour.

#

it works exactly like minecraft and the sourcecode in completely free just in the zip directory after extracting use these cmds:

gradlew build
gradlew shadowJar
java -jar jmccc-cli/build/libs/jmccc-cli-3.1.4.jar

NOTE: You may have to switch 3.1.4 with a different version depending on the time xfl03 changes it

#

Also these are the steps for windows, not mac/linux

#

btw

viral cave
#

there is no replacment for mcp, which is sad and id like to work on one (ive got knowledge on how to make gradle plugins), but id need someone to work with