#API and Chat Editing
114 messages · Page 1 of 1 (latest)
Wdym take information from a Github repo?
Also something else is that I want to know how to edit chat messages sent by other people, obviously this would not be visible by anyone else but it'd be useful
idk how to explain it
takes text
and turns it into code
its an array that gets implemented whenever you launch the mod
you know code needs to be compiled right?
and takes information from there
and what is this information exactly?
Its an array
and what is this array used for?
its for a chat replacement system that I want to be able to change easily without editing the code
I've done a similar thing before just not in java so im hoping its possible but if its not then thats sad
okay can you show that?
So you want an array somewhere so you can change variables in your mod without having to recompile every time?
Sounds like a config file
so basically a config
Check out malilib or cloth config (I recommend the latter)
you can't use a library for this if you're pulling the config outside of the game
What the fuck
and that shows the timing for when each beat was
its txt though
.
The file is literally txt
Doesn't matter
Then I'd get the text from github, put it in a string and use gson or Jackson or something to parse it
how?
Uh idk
you don't need to use the github api, you can make a raw content url and use that
how??
what do you want me to provide?
I just dont know how to get information from an API, thats all I need
Dicedpixels just said you dont need one
you don't need the api, raw urls are static
You ever have a big text file on github and it says "too big, view raw"?
Yeah that view raw link is the raw content url
nope it was on an mp3 file
huh
This is the important bit
raw urls don't change, you can change the file content and the url will still point you the same file
Idk exactly what the URL looks like but it's probably something like rawcontent.github.com/user/repo/file, then just replace user repo and file with what you want
how do I do that though, I dont normally use APIs
User and repo probably stay the same for you
oh yeah the URL, I understand now but like, how do I read from that inside the code?
yes
do you know java?
bearly
For example:
in your mod, you do String s = getData("https://rawcontent.github.com/kr1viah/MCmath/gradle.properties"), then, if its a valid url and getData exists (it probably does but idk it, google what it should be) in your string s you'll have the grade.properties of my mod's source code
that's not enough
I'm trying to learn it
this is not even minecraft modding at this point, it's intermediate level java
yes, learn first, then you'll understand what we're saying
Thats how I learnt python, I just made stuff until I knew it
Well I barely know java too I just know how to program ;)
that's not going to go well with minecraft modding
same
Its a very simple mod
Can confirm (i tried)
nothing complex
But anyways
anyway yeah that sounds about right i'll try it
(if you know programming, you won't be asking this question to begin with)
this is basically reading content from a URL
I know how to use APIs in other coding languages
If you have your own github repository with that songs data you change kr1viah, mcmath to the name and repo of that repository, then replace gradle.properties with the path to the song.txt place
For the 4th time you're not using an API here
We told you
Then parsing it as json
it would be the exact same if it was an API 
yes
Who cares what it's called you have a solution now
is there settings I have to change because getData doesnt work, do I need to import something?
what
Read
.
getData is not a real thing
it's.. pseudo code...